This commit is contained in:
2023-05-30 17:34:56 +08:00
parent e728c66786
commit 9da1c4cf30
194 changed files with 10680 additions and 9060 deletions

View File

@ -97,7 +97,7 @@ namespace IronIntel.Contractor
}
else if (DataType == CellDataType.Date)
{
ft = "MM-dd-yyyy";
ft = "M-d-yyyy";
}
else if (DataType == CellDataType.Bool)
{

View File

@ -228,7 +228,7 @@ namespace IronIntel.Contractor.ExportExcel
CellFormat cf = (CellFormat)stylepart.Stylesheet.CellFormats.ElementAt((int)cell.StyleIndex.Value);
if (cf.NumberFormatId >= 14 && cf.NumberFormatId <= 22)//Date
{
value = DateTime.FromOADate(d).ToString("MM/dd/yyyy");
value = DateTime.FromOADate(d).ToString("M/d/yyyy");
}
}
}

View File

@ -260,10 +260,10 @@ namespace IronIntel.Contractor
dr[0] = asset.DisplayName;
dr[1] = asset.VIN;
dr[2] = r.UserName;
dr[3] = r.AdjustmentLocalTime.ToString("M/d/yyyy h:m tt");
dr[3] = r.AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt");
dr[4] = r.Odometer;
dr[5] = r.UOM;
dr[6] = r.OdometerLocalTime.ToString("M/d/yyyy h:m tt");
dr[6] = r.OdometerLocalTime.ToString("M/d/yyyy h:mm tt");
dr[7] = r.Notes;
dt.Rows.Add(dr);
}
@ -314,9 +314,9 @@ namespace IronIntel.Contractor
dr[0] = asset.DisplayName;
dr[1] = asset.VIN;
dr[2] = r.UserName;
dr[3] = r.AdjustmentLocalTime.ToString("M/d/yyyy h:m tt");
dr[3] = r.AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt");
dr[4] = r.EngineHours;
dr[5] = r.EngineHoursLocalTime.ToString("M/d/yyyy h:m tt");
dr[5] = r.EngineHoursLocalTime.ToString("M/d/yyyy h:mm tt");
dr[6] = r.Notes;
dt.Rows.Add(dr);
}

View File

@ -83,7 +83,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTime.ToString("M/d/yyyy h:m tt");
return AsofTime.ToString("M/d/yyyy h:mm tt");
}
}
public DateTime AsofTimeLocal { get; set; }
@ -91,7 +91,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
}
}
}
@ -109,7 +109,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTime.ToString("M/d/yyyy h:m tt");
return AsofTime.ToString("M/d/yyyy h:mm tt");
}
}
public DateTime AsofTimeLocal { get; set; }
@ -117,7 +117,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
}
}
}
@ -133,7 +133,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTime.ToString("M/d/yyyy h:m tt");
return AsofTime.ToString("M/d/yyyy h:mm tt");
}
}
public DateTime AsofTimeLocal { get; set; }
@ -141,7 +141,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
}
}
}
@ -153,13 +153,13 @@ namespace IronIntel.Contractor.Machines
public string DisplayName { get; set; }//Asset Name
public string VIN { get; set; }
public DateTime AdjustmentTime { get; set; }
public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:m tt"); } }
public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:mm tt"); } }
public DateTime EngineHoursTime { get; set; }
public string EngineHoursTimeText { get { return EngineHoursTime.ToString("M/d/yyyy h:m tt"); } }
public string EngineHoursTimeText { get { return EngineHoursTime.ToString("M/d/yyyy h:mm tt"); } }
public DateTime AdjustmentLocalTime { get; set; }
public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:m tt"); } }
public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); } }
public DateTime EngineHoursLocalTime { get; set; }
public string EngineHoursLocalTimeText { get { return EngineHoursLocalTime.ToString("M/d/yyyy h:m tt"); } }
public string EngineHoursLocalTimeText { get { return EngineHoursLocalTime.ToString("M/d/yyyy h:mm tt"); } }
private double _EngineHours;
public double EngineHours

View File

@ -167,15 +167,15 @@ namespace IronIntel.Contractor.Machines
public string AddedOnStr
{
get { return AddedLocalTime == null ? "" : AddedLocalTime.Value.ToString("MM/dd/yyyy"); }
get { return AddedLocalTime == null ? "" : AddedLocalTime.Value.ToString("M/d/yyyy"); }
}
public string EngineHoursDateTimeStr
{
get { return EngineHoursLocalTime == null ? "" : EngineHoursLocalTime.Value.ToString("MM/dd/yyyy"); }
get { return EngineHoursLocalTime == null ? "" : EngineHoursLocalTime.Value.ToString("M/d/yyyy"); }
}
public string OdometerDateTimeStr
{
get { return OdometerLocalTime == null ? "" : OdometerLocalTime.Value.ToString("MM/dd/yyyy"); }
get { return OdometerLocalTime == null ? "" : OdometerLocalTime.Value.ToString("M/d/yyyy"); }
}
}
@ -316,10 +316,10 @@ namespace IronIntel.Contractor.Machines
public bool Utilization { get; set; }
public string SalesOrderNumber { get; set; }
public string AddDateStr { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToShortDateString(); } }
public string AddDateStr1 { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToString("yyyy-MM-dd"); } }
public string AddDateStr1 { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToString("M/D/yyyy"); } }
public string InvoiceDateStr { get { return InvoiceDate == null ? "" : InvoiceDate.Value.ToShortDateString(); } }
public string ServiceStartDateStr { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToShortDateString(); } }
public string ServiceStartDateStr1 { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToString("yyyy-MM-dd"); } }
public string ServiceStartDateStr1 { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToString("M/D/yyyy"); } }
}
public class PairedAssetItem
@ -339,7 +339,7 @@ namespace IronIntel.Contractor.Machines
public class CommentItem : Foresight.Fleet.Services.CommentInfo
{
public string SubmitDateStr { get { return SubmitLocalDate == DateTime.MinValue ? "" : SubmitLocalDate.ToString("M/d/yyyy h:m tt"); } }
public string SubmitDateStr { get { return SubmitLocalDate == DateTime.MinValue ? "" : SubmitLocalDate.ToString("M/d/yyyy h:mm tt"); } }
public void FormatFollowUp()
{
@ -357,7 +357,7 @@ namespace IronIntel.Contractor.Machines
}
public class InstallNotesItemC : Foresight.Fleet.Services.Device.InstallNotesItem
{
public string InstallTimeLocalStr { get { return InstallTimeLocal == DateTime.MinValue ? "" : InstallTimeLocal.ToString("M/d/yyyy h:m:s tt"); } }
public string InstallTimeLocalStr { get { return InstallTimeLocal == DateTime.MinValue ? "" : InstallTimeLocal.ToString("M/d/yyyy h:mm:ss tt"); } }
}
public class MachineGroup

View File

@ -277,73 +277,6 @@ namespace IronIntel.Contractor.Machines
}
}
public static MachineItem[] GetMachines(string sessionid, string useriid, string searchtxt, string companyid = null)
{
string SQL = "select " + string.Format(MachineFields, "") + " from MACHINES order by MACHINENAME";
FIDbAccess db = null;
if (string.IsNullOrEmpty(companyid))
{
companyid = SystemParams.CompanyID;
db = SystemParams.GetDbInstance();
}
else
{
string connetionstring = SystemParams.GetDbStringByCompany(companyid);
db = new FISqlConnection(connetionstring);
}
DataTable tb = db.GetDataTableBySQL(SQL);
if (tb.Rows.Count == 0)
{
return new MachineItem[0];
}
long[] availableAssetsids = null;
IronIntel.Contractor.Users.UserInfo user = null;
if (!string.IsNullOrWhiteSpace(useriid))
{
user = Users.UserManagement.GetUserByIID(useriid);
if (user.UserType < Users.UserTypes.Admin)
availableAssetsids = FleetServiceClientHelper.CreateClient<AssetQueryClient>(companyid, sessionid).GetAvailableAssetsForUsers(companyid, useriid);
}
RefreshBaseData();
AssetMake[] makes = GetMachineMakes();
AssetModel[] models = GetMachineModels();
AssetType[] types = GetMachineTypes();
List<MachineItem> ls = new List<MachineItem>();
if (tb.Rows.Count > 0)
{
foreach (DataRow dr in tb.Rows)
{
long mid = FIDbAccess.GetFieldInt64(dr["MACHINEID"], 0);
if (!string.IsNullOrWhiteSpace(useriid) && user.UserType < Users.UserTypes.Admin && !availableAssetsids.Contains(mid))
continue;
MachineItem mi = ConvertToMachineItem(dr, makes, models, types);
if (!string.IsNullOrWhiteSpace(searchtxt))
{
if (Helper.Contains(mi.VIN, searchtxt)
|| Helper.Contains(mi.MachineID.ToString(), searchtxt)
|| Helper.Contains(mi.Name, searchtxt)
|| Helper.Contains(mi.Name2, searchtxt)
|| Helper.Contains(mi.Make, searchtxt)
|| Helper.Contains(mi.MachineType, searchtxt)
|| Helper.Contains(mi.Model, searchtxt))
{
ls.Add(mi);
}
}
else
{
ls.Add(mi);
}
}
}
return ls.ToArray();
}
public static MachineItem[] GetSelectMachinesByRental(string sessionid, string useriid, string searchtxt, string companyid = null)
{

View File

@ -96,7 +96,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTime.ToString("M/d/yyyy h:m tt");
return AsofTime.ToString("M/d/yyyy h:mm tt");
}
}
public DateTime AsofTimeLocal { get; set; }
@ -104,7 +104,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
}
}
}
@ -124,7 +124,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTime.ToString("M/d/yyyy h:m tt");
return AsofTime.ToString("M/d/yyyy h:mm tt");
}
}
public DateTime AsofTimeLocal { get; set; }
@ -132,7 +132,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
}
}
}
@ -150,7 +150,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTime.ToString("M/d/yyyy h:m tt");
return AsofTime.ToString("M/d/yyyy h:mm tt");
}
}
public DateTime AsofTimeLocal { get; set; }
@ -158,7 +158,7 @@ namespace IronIntel.Contractor.Machines
{
get
{
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
}
}
}
@ -180,13 +180,13 @@ namespace IronIntel.Contractor.Machines
public string DisplayName { get; set; }//Asset Name
public string VIN { get; set; }
public DateTime AdjustmentTime { get; set; }
public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:m tt"); } }
public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:mm tt"); } }
public DateTime OdometerTime { get; set; }
public string OdometerTimeText { get { return OdometerTime.ToString("M/d/yyyy h:m tt"); } }
public string OdometerTimeText { get { return OdometerTime.ToString("M/d/yyyy h:mm tt"); } }
public DateTime AdjustmentLocalTime { get; set; }
public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:m tt"); } }
public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); } }
public DateTime OdometerLocalTime { get; set; }
public string OdometerLocalTimeText { get { return OdometerLocalTime.ToString("M/d/yyyy h:m tt"); } }
public string OdometerLocalTimeText { get { return OdometerLocalTime.ToString("M/d/yyyy h:mm tt"); } }
private double _Odometer;
public double Odometer

View File

@ -26,9 +26,9 @@ namespace IronIntel.Contractor.Maintenance
public string DriverName { get; set; }
public string TicketNumber { get; set; }
public DateTime TransactionDate { get; set; }
public string TransactionDateStr { get { return TransactionDate == DateTime.MinValue ? "" : TransactionDate.ToString("M/d/yyyy h:m tt"); } }
public string TransactionDateStr { get { return TransactionDate == DateTime.MinValue ? "" : TransactionDate.ToString("M/d/yyyy h:mm tt"); } }
public DateTime TransactionLocalDate { get; set; }
public string TransactionLocalDateStr { get { return TransactionLocalDate == DateTime.MinValue ? "" : TransactionLocalDate.ToString("M/d/yyyy h:m tt"); } }
public string TransactionLocalDateStr { get { return TransactionLocalDate == DateTime.MinValue ? "" : TransactionLocalDate.ToString("M/d/yyyy h:mm tt"); } }
public string AssetModel { get; set; }
public string AssetMake { get; set; }
public string AssetType { get; set; }
@ -52,14 +52,14 @@ namespace IronIntel.Contractor.Maintenance
public string LasetUpdatedBy { get; set; }
public string LasetUpdatedByName { get; set; }
public DateTime AddedOn { get; set; }
public string AddedOnStr { get { return AddedOn == DateTime.MinValue ? "" : AddedOn.ToString("M/d/yyyy h:m:s tt"); } }
public string AddedOnStr { get { return AddedOn == DateTime.MinValue ? "" : AddedOn.ToString("M/d/yyyy h:mm:ss tt"); } }
public DateTime LastUpdatedOn { get; set; }
public string LastUpdatedOnStr { get { return LastUpdatedOn == DateTime.MinValue ? "" : LastUpdatedOn.ToString("M/d/yyyy h:m:s tt"); } }
public string LastUpdatedOnStr { get { return LastUpdatedOn == DateTime.MinValue ? "" : LastUpdatedOn.ToString("M/d/yyyy h:mm:ss tt"); } }
public DateTime AddedOn_Local { get; set; }
public string AddedOn_LocalStr { get { return AddedOn_Local == DateTime.MinValue ? "" : AddedOn_Local.ToString("M/d/yyyy h:m:s tt"); } }
public string AddedOn_LocalStr { get { return AddedOn_Local == DateTime.MinValue ? "" : AddedOn_Local.ToString("M/d/yyyy h:mm:ss tt"); } }
public DateTime LastUpdatedOn_Local { get; set; }
public string LastUpdatedOn_LocalStr { get { return LastUpdatedOn_Local == DateTime.MinValue ? "" : LastUpdatedOn_Local.ToString("M/d/yyyy h:m:s tt"); } }
public string LastUpdatedOn_LocalStr { get { return LastUpdatedOn_Local == DateTime.MinValue ? "" : LastUpdatedOn_Local.ToString("M/d/yyyy h:mm:ss tt"); } }
}
}

View File

@ -110,7 +110,7 @@ namespace IronIntel.Contractor.Maintenance
{
if (AlertTime != DateTime.MinValue)
{
return AlertTime.ToString("M/d/yyyy h:m:s tt");
return AlertTime.ToString("M/d/yyyy h:mm:ss tt");
}
return "";
}
@ -249,7 +249,7 @@ namespace IronIntel.Contractor.Maintenance
if (StartDate == null)
return "";
else
return StartDate.Value.ToString("MM/dd/yyyy");
return StartDate.Value.ToString("M/d/yyyy");
}
}
public string LastAlertTimeString
@ -259,7 +259,7 @@ namespace IronIntel.Contractor.Maintenance
if (LastAlertTime == null)
return "";
else
return LastAlertTime.Value.ToString("MM/dd/yyyy");
return LastAlertTime.Value.ToString("M/d/yyyy");
}
}
}

View File

@ -434,7 +434,7 @@ namespace IronIntel.Contractor.Maintenance
alert.AlertTitle = FIDbAccess.GetFieldString(dr["ALERTTITLE"], string.Empty);
DateTime at = FIDbAccess.GetFieldDateTime(dr["ALERTTIME_UTC"], DateTime.MinValue);
if (at != DateTime.MinValue)
alert.AlertTime = at.ToString("M/d/yyyy h:m:s tt");
alert.AlertTime = at.ToString("M/d/yyyy h:mm:ss tt");
alerts.Add(alert);
}
return alerts.ToArray();

View File

@ -129,14 +129,14 @@ namespace IronIntel.Contractor.Maintenance
ls.Add(p.CustomerNumber);
else
{
p.CustomerNumber = Foresight.Standard.PhoneNumber.PreparePhonenumber(p.CustomerNumber);
ls.Add(p.CustomerNumber);
p.CustomerNumber = Foresight.Standard.PhoneNumber.FormatPhoneNumber(p.CustomerNumber);
ls.Add(Foresight.Standard.PhoneNumber.PreparePhonenumber(p.CustomerNumber));
}
}
}
return ls.ToArray();
}
}
public string TimeStr { get { return Time == DateTime.MinValue ? "" : Time.ToString("M/d/yyyy h:m tt"); } }
public string TimeStr { get { return Time == DateTime.MinValue ? "" : Time.ToString("M/d/yyyy h:mm tt"); } }
}
}

View File

@ -32,16 +32,15 @@ namespace IronIntel.Contractor.MapView
qp.FilterString = filtertext;
qp.OnRoad = onroad;
qp.IncludeNoLocation = IncludeNoLocation;
qp.IncludeAssetGroups = true;
qp.IncludeJobSites = true;
if (param != null)
{
qp.ViewId = param.ViewID;
qp.AlertViewQueryParam = param;
}
qp.Attachment = attachment;
var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid);
AssetMapViewPinItem[] assets = client.GetAssets(companyid, useriid, qp, attachment);
AssetMapViewPinItem[] assets = client.GetAssets(companyid, useriid, qp);
List<AssetMapViewPinItemClient> result = new List<AssetMapViewPinItemClient>();
foreach (var a in assets)
{
@ -122,6 +121,94 @@ namespace IronIntel.Contractor.MapView
return results.ToArray();
}
/// <summary>
/// 根据Contractorid获取机器基础信息列表
/// </summary>
/// <returns></returns>
public static MapViewAssetItem[] GetAssetBasicInfos(string sessionid, string companyid, string useriid)
{
if (string.IsNullOrEmpty(companyid))
companyid = SystemParams.CompanyID;
var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid);
MapViewAssetItem[] assets = client.GetAvailableAssetItems(companyid, useriid);
return assets.OrderBy(a => a.Id).ToArray();
}
/// <summary>
/// 获取Dealer站点下多个Contractor机器几次信息列表
/// </summary>
/// <returns></returns>
public static MapViewAssetItem[] GetDealerAssetBasicInfos(string sessionid, string companyids, string useriid)
{
string[] cids = null;
if (!string.IsNullOrEmpty(companyids))
cids = companyids.Split(',');
var contractors = SystemParams.GetContractors();
if (cids == null || cids.Length == 0)
cids = contractors.Select(c => c.ID).ToArray();
if (cids == null || cids.Length == 0)
return new MapViewAssetItem[0];
int requestCount = 0;
Exception lasterror = null;
List<MapViewAssetItem> results = new List<MapViewAssetItem>();
foreach (var cid in cids)
{
requestCount++;
Thread th = new Thread((object state) =>
{
try
{
var assets = GetAssetBasicInfos(sessionid, cid, useriid);
lock (results)
{
results.AddRange(assets);
}
}
catch (Exception ex)
{
lasterror = ex;
}
requestCount--;
});
th.Start();
}
while (true)
{
Thread.Sleep(10);
if (requestCount == 0)
{
break;
}
}
if (lasterror != null)
{
throw lasterror;
}
return results.OrderBy(a => a.Id).ToArray();
}
/// <summary>
/// 根据机器ID获取机器基础信息列表
/// </summary>
/// <returns></returns>
public static MapViewAssetItem[] GetAssetItemsByAssets(string sessionid, string companyid, string useriid, long[] assetids)
{
if (string.IsNullOrEmpty(companyid))
companyid = SystemParams.CompanyID;
var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid);
MapViewAssetItem[] assets = client.GetAssetItemsByAssets(companyid, useriid, assetids);
return assets.OrderBy(a => a.Id).ToArray();
}
public static AssetDetailViewItem GetAssetDetailItem(string sessionid, string companyid, long machineid, string datasource = null)
{
var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(companyid, sessionid);

View File

@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("23.4.26")]
[assembly: AssemblyFileVersion("23.5.11")]