This commit is contained in:
2020-05-25 17:52:17 +08:00
parent cbef4076c4
commit befc93960b
24 changed files with 491 additions and 132 deletions

View File

@ -17,6 +17,7 @@ namespace IronIntel.Contractor.Maintenance
public string FuelTypeName { get; set; }
public string FuelType { get; set; }
public double Odomerter { get; set; }
public string OdometerUnits { get; set; }
public string RetailerZip { get; set; }
public string RetailerState { get; set; }
public string RetailerCity { get; set; }

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("2.20.430")]
[assembly: AssemblyFileVersion("2.20.525")]

View File

@ -7,6 +7,7 @@ using System.Data;
using Foresight.Data;
using IronIntel.Contractor.Users;
using IronIntel.Services;
using Foresight.Fleet.Services.User;
namespace IronIntel.Contractor.Users
{
@ -15,70 +16,38 @@ namespace IronIntel.Contractor.Users
private const string FITracker = "FITracker";
private const string Inspect = "Inspection";
private const string TeamIntelligence = "TeamIntelligence";
private const string FilterQ = "FilterQ";
public static AppModuleInfo[] GetAvailableAppModuleInfos(UserInfo user)
{
const string SQL = @"select ID,APPMODULENAME,APPMODULEDESC,URL,ICONPATH,BACKCOLOR,FORECOLOR,OPENINNEWWINDOW from APPMODULES where VISIBLE>0 and (isnull(SITETYPE,'All')='All' or SITETYPE={0}) ";
if (user == null)
{
return new AppModuleInfo[0];
}
string sql = SQL;
switch (user.UserType)
{
case UserTypes.Readonly:
sql = SQL + " and SECURITYLEVEL=0";
break;
case UserTypes.Common:
sql = SQL + " and SECURITYLEVEL<=1";
break;
case UserTypes.Admin:
sql = SQL + " and SECURITYLEVEL<=2";
break;
case UserTypes.SupperAdmin:
sql = SQL + " and SECURITYLEVEL<=3";
break;
default:
sql = SQL;
break;
}
sql = sql + " order by ORDERINDEX ";
FIDbAccess db = SystemParams.GetDbInstance();
DataTable dt = db.GetDataTableBySQL(sql, SystemParams.CustomerDetail.CustomerType);
CustUIStyle style = SystemParams.GetUIStyle(user.IID);//获取样式设置
string moudleBackgroundColor = "#0078D7";
if (style != null && !string.IsNullOrEmpty(style.MenuBackgroundColor))
moudleBackgroundColor = style.MenuBackgroundColor;
List<AppModuleInfo> list = new List<AppModuleInfo>();
bool fitracter = SystemParams.HasLicense(FITracker);
bool inspect = SystemParams.HasLicense(Inspect);
bool teamintelligence = SystemParams.HasLicense(TeamIntelligence);
foreach (DataRow dr in dt.Rows)
var pc = FleetServiceClientHelper.CreateClient<PermissionProvider>();
FeatureModule[] ms = pc.GetAvailableModules(SystemParams.CompanyID, user.IID);
List<FeatureModule> moudles = new List<FeatureModule>();
moudles.AddRange(ms);
if (ms.FirstOrDefault(m => m.Id == FeatureModule.MODULE_MAPVIEW) == null)
moudles.Insert(0, FeatureModule.Modules[0]);
foreach (var m in moudles)
{
AppModuleInfo ami = ConvertToAppModule(dr);
ami.BackColor = moudleBackgroundColor;
if (ami.ID.Equals(FITracker, StringComparison.OrdinalIgnoreCase))
{
if (fitracter)
list.Add(ami);
}
else if (ami.ID.Equals(Inspect, StringComparison.OrdinalIgnoreCase))
{
if (inspect)
list.Add(ami);
}
else if (ami.ID.Equals(TeamIntelligence, StringComparison.OrdinalIgnoreCase))
{
if (teamintelligence)
list.Add(ami);
}
else
list.Add(ami);
AppModuleInfo ami = new AppModuleInfo();
ami.ID = m.Id.ToString();
ami.Name = m.Name;
ami.Description = m.Description;
ami.Url = m.Url;
ami.IconPath = m.IconPath;
ami.BackColor = m.BackgroundColor;
ami.ForeColor = m.ForeColor;
ami.OpenInNewWindow = false;
ami.Visible = true;
ami.ModuleType = AppModuleType.System;
list.Add(ami);
}
AppModuleInfo[] wsps = GetFICWorkspace(user);
foreach (AppModuleInfo ap in wsps)

View File

@ -32,6 +32,9 @@ namespace IronIntel.Contractor.Users
public decimal HourlyRate { get; set; }
public string[] GroupIDs { get; set; }
public string[] GroupNames { get; set; }
public bool AllowLoginIntoPC { get; set; }
public bool AllowLoginIntoInspectMobile { get; set; }
public bool AllowLoginIntoFleetMobile { get; set; }
public string GroupNamesStr { get { return (GroupNames == null || GroupNames.Length == 0) ? "" : string.Join(",", GroupNames); } }
public string ContactTypeName

View File

@ -109,6 +109,9 @@ namespace IronIntel.Contractor.Users
u.TeamIntelligenceUser = user.TeamIntelligenceUser;
u.FOB = user.FOB;
u.HourlyRate = user.HourlyRate;
u.AllowLoginIntoPC = user.AllowLoginIntoPC;
u.AllowLoginIntoFleetMobile = user.AllowLoginIntoFleetMobile;
u.AllowLoginIntoInspectMobile = user.AllowLoginIntoInspectMobile;
return u;
}
@ -135,6 +138,9 @@ namespace IronIntel.Contractor.Users
u.TeamIntelligenceUser = user.TeamIntelligenceUser;
u.FOB = user.FOB;
u.HourlyRate = user.HourlyRate;
u.AllowLoginIntoPC = user.AllowLoginIntoPC;
u.AllowLoginIntoFleetMobile = user.AllowLoginIntoFleetMobile;
u.AllowLoginIntoInspectMobile = user.AllowLoginIntoInspectMobile;
return u;
}