Merge branch 'master' of http://101.43.201.20:3000/yanghongwei/lg_backend
This commit is contained in:
		
						commit
						3852e62f58
					
				| 
						 | 
				
			
			@ -41,32 +41,64 @@
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        public string V5Percent { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 国五比例数量
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public double V5Numer { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 国五运输量百分比
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public string V5WeightPercent { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 国五运输量比例
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public double V5WeightNumber { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 国六百分比
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public string V6Percent { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 国六运输量
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public double V6Number { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 国六运输量百分比
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public string V6WeightPercent { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 国六运输量
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public double V6WeightNumber { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 电动百分比
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public string ElectricPrecent { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 电动运输量
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public double ElectricNumber { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 电动运输量百分比
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public string ElectricWeightPrecent { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 电动运输量
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public double ElectricWeightNumber { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 其他百分比
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public string OtherPrecent { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 其他运输量
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public double OtherNumber { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 其他运输量百分比
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public string OtherWeightPrecent { get; set; }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 其他运输量
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public double OtherWeightNumber { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -132,6 +132,34 @@
 | 
			
		|||
        public string TransportTypeString { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string TimeString { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///  排放标准(0-7是国1-7,D:电动  X:无排放阶段)
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public string EmissionLevelString(string sort)
 | 
			
		||||
        {
 | 
			
		||||
            switch (sort)
 | 
			
		||||
            {
 | 
			
		||||
                case "1":
 | 
			
		||||
                    return "国I";
 | 
			
		||||
                case "2":
 | 
			
		||||
                    return "国II";
 | 
			
		||||
                case "3":
 | 
			
		||||
                    return "国III";
 | 
			
		||||
                case "4":
 | 
			
		||||
                    return "国IV";
 | 
			
		||||
                case "5":
 | 
			
		||||
                    return "国V";
 | 
			
		||||
                case "6":
 | 
			
		||||
                    return "国VI";
 | 
			
		||||
                case "7":
 | 
			
		||||
                    return "国VII";
 | 
			
		||||
                case "D":
 | 
			
		||||
                    return "电动";
 | 
			
		||||
                default:
 | 
			
		||||
                    return "无排放阶段";
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    public enum CarColor
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,7 +55,8 @@ namespace langguanApi.Service
 | 
			
		|||
                    var entity = item.Adapt<TransportDto>();
 | 
			
		||||
                    entity.CarColorString = GetColorString(item.CarColor);
 | 
			
		||||
                    entity.TransportTypeString = item.TransportType == 1 ? "进场" : "出场";
 | 
			
		||||
                    entity.TimeString = item.Time.ToString();
 | 
			
		||||
                    entity.TimeString = item.Time.ToString("yyyy-MM-dd HH:mm:ss");
 | 
			
		||||
                    entity.effluent = GetEffluentString(item.effluent);
 | 
			
		||||
                    result.Add(entity);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -108,7 +109,7 @@ namespace langguanApi.Service
 | 
			
		|||
                        CarColor = GetColorString(transport.CarColor),
 | 
			
		||||
                        CarNumber = transport.CarNumber,
 | 
			
		||||
                        CarType = transport.CarType,
 | 
			
		||||
                        Time = transport.Time.ToString(),
 | 
			
		||||
                        Time = transport.Time.ToString("yyyy-MM-dd HH:mm:ss"),
 | 
			
		||||
                        Weight = item.Weight,
 | 
			
		||||
                        Effluent = GetEffluentString(transport.effluent)
 | 
			
		||||
                    }); 
 | 
			
		||||
| 
						 | 
				
			
			@ -129,13 +130,21 @@ namespace langguanApi.Service
 | 
			
		|||
            if (result.cleans.Any())
 | 
			
		||||
            {
 | 
			
		||||
                result.V5Percent =((double)result.cleans.Count(p => p.Effluent == "国五") / result.cleans.Count()).ToString();
 | 
			
		||||
                result.V5Numer = (double)result.cleans.Count(p => p.Effluent == "国五");
 | 
			
		||||
                result.V5WeightPercent = (result.cleans.Where(p => p.Effluent == "国五").Sum(p=>p.Weight) / result.cleans.Sum(p=>p.Weight)).ToString("0.00");
 | 
			
		||||
                result.V5WeightNumber = result.cleans.Where(p => p.Effluent == "国五").Sum(p => p.Weight);
 | 
			
		||||
                result.V6Percent = ((double)result.cleans.Count(p => p.Effluent == "国六") / result.cleans.Count()).ToString("0.00");
 | 
			
		||||
                result.V6Number = (double)result.cleans.Count(p => p.Effluent == "国六");
 | 
			
		||||
                result.V6WeightPercent = (result.cleans.Where(p => p.Effluent == "国六").Sum(p => p.Weight) / result.cleans.Sum(p => p.Weight)).ToString("0.00");
 | 
			
		||||
                result.V6WeightNumber = result.cleans.Where(p => p.Effluent == "国六").Sum(p => p.Weight);
 | 
			
		||||
                result.ElectricPrecent = ((double)result.cleans.Count(p => p.Effluent == "电动") / result.cleans.Count()).ToString("0.00");
 | 
			
		||||
                result.ElectricNumber = (double)result.cleans.Count(p => p.Effluent == "电动");
 | 
			
		||||
                result.ElectricWeightPrecent = (result.cleans.Where(p => p.Effluent == "电动").Sum(p => p.Weight) / result.cleans.Sum(p => p.Weight)).ToString("0.00");
 | 
			
		||||
                result.ElectricWeightNumber = result.cleans.Where(p => p.Effluent == "电动").Sum(p => p.Weight);
 | 
			
		||||
                result.OtherPrecent = ((double)result.cleans.Count(p => p.Effluent != "电动" && p.Effluent != "国五" && p.Effluent != "国六") / result.cleans.Count()).ToString("0.00");
 | 
			
		||||
                result.OtherNumber = (double)result.cleans.Count(p => p.Effluent != "电动" && p.Effluent != "国五" && p.Effluent != "国六");
 | 
			
		||||
                result.OtherWeightPrecent = (result.cleans.Where(p => p.Effluent != "电动" && p.Effluent != "国五" && p.Effluent != "国六").Sum(p => p.Weight) / result.cleans.Sum(p => p.Weight)).ToString("0.00");
 | 
			
		||||
                result.OtherWeightNumber = (double)result.cleans.Where(p => p.Effluent != "电动" && p.Effluent != "国五" && p.Effluent != "国六").Sum(p => p.Weight);
 | 
			
		||||
            }
 | 
			
		||||
            return new ApiResult()
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue