sync
This commit is contained in:
@ -20,7 +20,7 @@ namespace IronIntel.Contractor.MapView
|
||||
/// 根据Contractorid获取机器列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static AssetViewItem[] GetAssets(string sessionid, string companyid, string useriid, string filtertext, int onroad, MachineAlertViewQueryParameter param, bool IncludeNoLocation)
|
||||
public static AssetMapViewPinItem[] GetAssets(string sessionid, string companyid, string useriid, string filtertext, int onroad, MachineAlertViewQueryParameter param, bool IncludeNoLocation)
|
||||
{
|
||||
if (string.IsNullOrEmpty(companyid))
|
||||
companyid = SystemParams.CompanyID;
|
||||
@ -39,14 +39,15 @@ namespace IronIntel.Contractor.MapView
|
||||
|
||||
var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid);
|
||||
AssetMapViewPinItem[] assets = client.GetAssets(companyid, useriid, qp);
|
||||
List<AssetViewItem> result = new List<AssetViewItem>();
|
||||
foreach (var a in assets)
|
||||
{
|
||||
AssetViewItem avi = new AssetViewItem();
|
||||
Helper.CloneProperty(avi, a);
|
||||
result.Add(avi);
|
||||
}
|
||||
return result.ToArray();
|
||||
return assets;
|
||||
//List<AssetViewItem> result = new List<AssetViewItem>();
|
||||
//foreach (var a in assets)
|
||||
//{
|
||||
// AssetViewItem avi = new AssetViewItem();
|
||||
// Helper.CloneProperty(avi, a);
|
||||
// result.Add(avi);
|
||||
//}
|
||||
//return result.ToArray();
|
||||
}
|
||||
|
||||
public static AssetDetailViewItem GetAssetDetailItem(string sessionid, string companyid, long machineid, string datasource = null)
|
||||
@ -65,6 +66,7 @@ namespace IronIntel.Contractor.MapView
|
||||
mi.GroupNames = asset.GroupNames;
|
||||
mi.IconUrl = asset.MapViewIconUrl;
|
||||
mi.AssetIconUrl = asset.AssetIconUrl;
|
||||
mi.Description = asset.Description;
|
||||
|
||||
if (asset.CurrentHours != null)
|
||||
{
|
||||
@ -226,8 +228,8 @@ namespace IronIntel.Contractor.MapView
|
||||
|
||||
var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(companyid, sessionid);
|
||||
AssetBasicInfo asset = client.GetAssetBasicInfoByID(companyid, Convert.ToInt64(machineid));
|
||||
AssetViewItem ai = new AssetViewItem();
|
||||
Helper.CloneProperty(ai, asset);
|
||||
//AssetViewItem ai = new AssetViewItem();
|
||||
//Helper.CloneProperty(ai, asset);
|
||||
|
||||
double timeOffset = SystemParams.GetHoursOffset();
|
||||
startTime = startTime.AddHours(-timeOffset);
|
||||
@ -257,7 +259,7 @@ namespace IronIntel.Contractor.MapView
|
||||
ls.Add(li);
|
||||
}
|
||||
AssetLocationHistoryViewItem al = new AssetLocationHistoryViewItem();
|
||||
al.Machine = ai;
|
||||
al.Machine = asset;
|
||||
al.Locations = ls.ToArray();
|
||||
return al;
|
||||
}
|
||||
|
@ -9,39 +9,6 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace IronIntel.Contractor.MapView
|
||||
{
|
||||
public class AssetViewItem
|
||||
{
|
||||
public long ID { get; set; }
|
||||
public string VIN { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Name2 { get; set; }
|
||||
public string Make { get; set; }
|
||||
public string Model { get; set; }
|
||||
public int Priority { get; set; }
|
||||
public string AssetType { get; set; }
|
||||
public double Latitude { get; set; }
|
||||
public double Longitude { get; set; }
|
||||
public string IconUrl { get; set; }
|
||||
public string AlertTips { get; set; }
|
||||
public List<string> AssetGroups { get; set; }
|
||||
public List<long> JobSites { get; set; }
|
||||
public string ShowName
|
||||
{
|
||||
get
|
||||
{
|
||||
//Name取值顺序为Name2,Name,VIN,ID用于前端显示
|
||||
string name = Name2;
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
name = Name;
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
name = VIN;
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
name = ID.ToString();
|
||||
return name;
|
||||
}
|
||||
}//由于地图显示及排序的名称
|
||||
|
||||
}
|
||||
public class AssetDetailViewItem
|
||||
{
|
||||
private double _EngineHours;
|
||||
@ -84,6 +51,7 @@ namespace IronIntel.Contractor.MapView
|
||||
public long ID { get; set; }
|
||||
public string IconUrl { get; set; }
|
||||
public string AssetIconUrl { get; set; }
|
||||
public string Description { get; set; }
|
||||
public LocationViewItem Location { get; set; }
|
||||
public string EngineHoursDateText
|
||||
{
|
||||
@ -100,7 +68,7 @@ namespace IronIntel.Contractor.MapView
|
||||
|
||||
public class AssetLocationHistoryViewItem
|
||||
{
|
||||
public AssetViewItem Machine { get; set; }
|
||||
public AssetBasicInfo Machine { get; set; }
|
||||
public LocationViewItem[] Locations { get; set; }
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ namespace IronIntel.Contractor.MapView
|
||||
public int MapAlertLayerPriority { get; set; }
|
||||
public Int64 GpsDeviceID { get; set; } //空 -1
|
||||
public string AssetGroupNames { get; set; }
|
||||
public string ShowName
|
||||
public string DisplayName
|
||||
{
|
||||
get
|
||||
{
|
||||
|
Reference in New Issue
Block a user