全面修改Id为Guid类型,为2.0版做准备
59
Infrastructure/Encryption.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using System;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Infrastructure
|
||||||
|
{
|
||||||
|
public class Encryption
|
||||||
|
{
|
||||||
|
private static string encryptKey = "4h!@w$rng,i#$@x1%)5^3(7*5P31/Ee0";
|
||||||
|
|
||||||
|
//默认密钥向量
|
||||||
|
private static byte[] Keys = { 0x41, 0x72, 0x65, 0x79, 0x6F, 0x75, 0x6D, 0x79, 0x53, 0x6E, 0x6F, 0x77, 0x6D, 0x61, 0x6E, 0x3F };
|
||||||
|
/// <summary>
|
||||||
|
/// 加密
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="encryptString"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string Encrypt(string encryptString)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(encryptString))
|
||||||
|
return string.Empty;
|
||||||
|
RijndaelManaged rijndaelProvider = new RijndaelManaged();
|
||||||
|
rijndaelProvider.Key = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 32));
|
||||||
|
rijndaelProvider.IV = Keys;
|
||||||
|
ICryptoTransform rijndaelEncrypt = rijndaelProvider.CreateEncryptor();
|
||||||
|
|
||||||
|
byte[] inputData = Encoding.UTF8.GetBytes(encryptString);
|
||||||
|
byte[] encryptedData = rijndaelEncrypt.TransformFinalBlock(inputData, 0, inputData.Length);
|
||||||
|
|
||||||
|
return Convert.ToBase64String(encryptedData);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 解密
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="decryptString"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string Decrypt(string decryptString)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(decryptString))
|
||||||
|
return string.Empty;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
RijndaelManaged rijndaelProvider = new RijndaelManaged();
|
||||||
|
rijndaelProvider.Key = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 32));
|
||||||
|
rijndaelProvider.IV = Keys;
|
||||||
|
ICryptoTransform rijndaelDecrypt = rijndaelProvider.CreateDecryptor();
|
||||||
|
|
||||||
|
byte[] inputData = Convert.FromBase64String(decryptString);
|
||||||
|
byte[] decryptedData = rijndaelDecrypt.TransformFinalBlock(inputData, 0, inputData.Length);
|
||||||
|
|
||||||
|
return Encoding.UTF8.GetString(decryptedData);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -91,6 +91,7 @@
|
|||||||
<Compile Include="Filter.cs" />
|
<Compile Include="Filter.cs" />
|
||||||
<Compile Include="GenerateId.cs" />
|
<Compile Include="GenerateId.cs" />
|
||||||
<Compile Include="HttpHelper.cs" />
|
<Compile Include="HttpHelper.cs" />
|
||||||
|
<Compile Include="JQData.cs" />
|
||||||
<Compile Include="JsonConverter.cs" />
|
<Compile Include="JsonConverter.cs" />
|
||||||
<Compile Include="JsonHelper.cs" />
|
<Compile Include="JsonHelper.cs" />
|
||||||
<Compile Include="LogHelper.cs" />
|
<Compile Include="LogHelper.cs" />
|
||||||
|
|||||||
39
Infrastructure/JQData.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
// ***********************************************************************
|
||||||
|
// Assembly : FundationAdmin
|
||||||
|
// Author : yubaolee
|
||||||
|
// Created : 03-09-2016
|
||||||
|
//
|
||||||
|
// Last Modified By : yubaolee
|
||||||
|
// Last Modified On : 03-09-2016
|
||||||
|
// ***********************************************************************
|
||||||
|
// <copyright file="JqData.cs" company="Microsoft">
|
||||||
|
// 版权所有(C) Microsoft 2015
|
||||||
|
// </copyright>
|
||||||
|
// <summary>jqGrid的数据格式</summary>
|
||||||
|
// ***********************************************************************
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Entity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// jqGrid的返回值
|
||||||
|
/// </summary>
|
||||||
|
public class JqData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 页码
|
||||||
|
/// </summary>
|
||||||
|
public int page;
|
||||||
|
/// <summary>
|
||||||
|
/// 总页数
|
||||||
|
/// </summary>
|
||||||
|
public int total;
|
||||||
|
/// <summary>
|
||||||
|
/// 总记录条数
|
||||||
|
/// </summary>
|
||||||
|
public int records;
|
||||||
|
|
||||||
|
public IEnumerable<object> rows;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,9 +19,9 @@ namespace OpenAuth.App
|
|||||||
_orgRepository = orgRepository;
|
_orgRepository = orgRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetCategoryCntInOrg(int orgId)
|
public int GetCategoryCntInOrg(Guid orgId)
|
||||||
{
|
{
|
||||||
if (orgId == 0)
|
if (orgId == Guid.Empty)
|
||||||
{
|
{
|
||||||
return _repository.Find(null).Count();
|
return _repository.Find(null).Count();
|
||||||
}
|
}
|
||||||
@@ -39,11 +39,11 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载一个部门及子部门全部Categorys
|
/// 加载一个部门及子部门全部Categorys
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(int parentId, int pageindex, int pagesize)
|
public dynamic Load(Guid parentId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
IEnumerable<Category> Categorys;
|
IEnumerable<Category> Categorys;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
if (parentId == 0)
|
if (parentId == Guid.Empty)
|
||||||
{
|
{
|
||||||
Categorys = _repository.LoadCategorys(pageindex, pagesize);
|
Categorys = _repository.LoadCategorys(pageindex, pagesize);
|
||||||
total = _repository.GetCount();
|
total = _repository.GetCount();
|
||||||
@@ -66,14 +66,14 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取当前组织的所有下级组织
|
/// 获取当前组织的所有下级组织
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int[] GetSubCategories(int orgId)
|
private Guid[] GetSubCategories(Guid orgId)
|
||||||
{
|
{
|
||||||
var category = Find(orgId);
|
var category = Find(orgId);
|
||||||
var categories = _repository.Find(u => u.CascadeId.Contains(category.CascadeId)).Select(u => u.Id).ToArray();
|
var categories = _repository.Find(u => u.CascadeId.Contains(category.CascadeId)).Select(u => u.Id).ToArray();
|
||||||
return categories;
|
return categories;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Category Find(int id)
|
public Category Find(Guid id)
|
||||||
{
|
{
|
||||||
var category = _repository.FindSingle(u => u.Id == id);
|
var category = _repository.FindSingle(u => u.Id == id);
|
||||||
if (category == null) return new Category();
|
if (category == null) return new Category();
|
||||||
@@ -81,7 +81,7 @@ namespace OpenAuth.App
|
|||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
_repository.Delete(id);
|
_repository.Delete(id);
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ namespace OpenAuth.App
|
|||||||
model.CopyTo(category);
|
model.CopyTo(category);
|
||||||
ChangeModuleCascade(category);
|
ChangeModuleCascade(category);
|
||||||
|
|
||||||
if (category.Id == 0)
|
if (category.Id == Guid.Empty)
|
||||||
{
|
{
|
||||||
_repository.Add(category);
|
_repository.Add(category);
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ namespace OpenAuth.App
|
|||||||
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (org.ParentId != 0)
|
if (org.ParentId != Guid.Empty)
|
||||||
{
|
{
|
||||||
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
||||||
if (parentOrg != null)
|
if (parentOrg != null)
|
||||||
|
|||||||
45
OpenAuth.App/GoodsApplyApp.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using OpenAuth.Domain;
|
||||||
|
using OpenAuth.Domain.Interface;
|
||||||
|
|
||||||
|
namespace OpenAuth.App
|
||||||
|
{
|
||||||
|
public class GoodsApplyApp
|
||||||
|
{
|
||||||
|
private IRepository<GoodsApply> _repository;
|
||||||
|
|
||||||
|
public GoodsApplyApp(IRepository<GoodsApply> repository)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddOrUpdate(GoodsApply model)
|
||||||
|
{
|
||||||
|
if (model.Id == Guid.Empty)
|
||||||
|
{
|
||||||
|
_repository.Add(model);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_repository.Update(u => u.Id == model.Id, u => new GoodsApply
|
||||||
|
{
|
||||||
|
UserId = model.UserId,
|
||||||
|
Name = model.Name,
|
||||||
|
Number = model.Number
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public GoodsApply Get(Guid value)
|
||||||
|
{
|
||||||
|
return _repository.FindSingle(u =>u.Id == value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<GoodsApply> Load(Guid userid, Guid parentId, int pageCurrent, int pageSize)
|
||||||
|
{
|
||||||
|
return _repository.Find( pageCurrent, pageSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
// <summary>模块元素</summary>
|
// <summary>模块元素</summary>
|
||||||
// ***********************************************************************
|
// ***********************************************************************
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
@@ -40,7 +41,7 @@ namespace OpenAuth.App
|
|||||||
_moduleEleManService.AddOrUpdate(newbtn);
|
_moduleEleManService.AddOrUpdate(newbtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<ModuleElement> LoadByModuleId(int id)
|
public IEnumerable<ModuleElement> LoadByModuleId(Guid id)
|
||||||
{
|
{
|
||||||
string username = AuthUtil.GetUserName();
|
string username = AuthUtil.GetUserName();
|
||||||
return _moduleEleManService.LoadByModuleId(username, id);
|
return _moduleEleManService.LoadByModuleId(username, id);
|
||||||
@@ -55,7 +56,7 @@ namespace OpenAuth.App
|
|||||||
/// 当为UserElement时,表示UserId
|
/// 当为UserElement时,表示UserId
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="moduleId">模块ID</param>
|
/// <param name="moduleId">模块ID</param>
|
||||||
public List<dynamic> LoadWithAccess(string accessType, int firstId, int moduleId)
|
public List<dynamic> LoadWithAccess(string accessType, Guid firstId, Guid moduleId)
|
||||||
{
|
{
|
||||||
string username = AuthUtil.GetUserName();
|
string username = AuthUtil.GetUserName();
|
||||||
return _moduleEleManService.LoadWithAccess(username, accessType, firstId, moduleId);
|
return _moduleEleManService.LoadWithAccess(username, accessType, firstId, moduleId);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Infrastructure;
|
using System;
|
||||||
|
using Infrastructure;
|
||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
@@ -19,12 +20,12 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载一个节点下面的所有
|
/// 加载一个节点下面的所有
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(int parentId, int pageindex, int pagesize)
|
public dynamic Load(Guid parentId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
return _moduleManService.Load(AuthUtil.GetUserName(), parentId, pageindex, pagesize);
|
return _moduleManService.Load(AuthUtil.GetUserName(), parentId, pageindex, pagesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
_moduleManService.Delete(id);
|
_moduleManService.Delete(id);
|
||||||
}
|
}
|
||||||
@@ -43,7 +44,7 @@ namespace OpenAuth.App
|
|||||||
/// TODO:这里会加载用户及用户角色的所有模块,“为用户分配模块”功能会给人一种混乱的感觉,但可以接受
|
/// TODO:这里会加载用户及用户角色的所有模块,“为用户分配模块”功能会给人一种混乱的感觉,但可以接受
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId">The user unique identifier.</param>
|
/// <param name="userId">The user unique identifier.</param>
|
||||||
public List<Module> LoadForUser(int userId)
|
public List<Module> LoadForUser(Guid userId)
|
||||||
{
|
{
|
||||||
return _moduleManService.LoadForUser(userId);
|
return _moduleManService.LoadForUser(userId);
|
||||||
}
|
}
|
||||||
@@ -52,7 +53,7 @@ namespace OpenAuth.App
|
|||||||
/// 加载特定角色的模块
|
/// 加载特定角色的模块
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="roleId">The role unique identifier.</param>
|
/// <param name="roleId">The role unique identifier.</param>
|
||||||
public List<Module> LoadForRole(int roleId)
|
public List<Module> LoadForRole(Guid roleId)
|
||||||
{
|
{
|
||||||
return _moduleManService.LoadForRole(roleId);
|
return _moduleManService.LoadForRole(roleId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,7 @@
|
|||||||
<Compile Include="SSO\SSOAuthAttribute.cs" />
|
<Compile Include="SSO\SSOAuthAttribute.cs" />
|
||||||
<Compile Include="SSO\UserAuthSession.cs" />
|
<Compile Include="SSO\UserAuthSession.cs" />
|
||||||
<Compile Include="SSO\UserAuthSessionService.cs" />
|
<Compile Include="SSO\UserAuthSessionService.cs" />
|
||||||
|
<Compile Include="GoodsApplyApp.cs" />
|
||||||
<Compile Include="StockManagerApp.cs" />
|
<Compile Include="StockManagerApp.cs" />
|
||||||
<Compile Include="UserManagerApp.cs" />
|
<Compile Include="UserManagerApp.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace OpenAuth.App
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="orgId">The org unique identifier.</param>
|
/// <param name="orgId">The org unique identifier.</param>
|
||||||
/// <returns>IEnumerable{Org}.</returns>
|
/// <returns>IEnumerable{Org}.</returns>
|
||||||
public IList<Org> LoadDirectChildren(int orgId)
|
public IList<Org> LoadDirectChildren(Guid orgId)
|
||||||
{
|
{
|
||||||
return _repository.Find(u => u.ParentId == orgId).ToList();
|
return _repository.Find(u => u.ParentId == orgId).ToList();
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ namespace OpenAuth.App
|
|||||||
/// 得到部门的所有子部门
|
/// 得到部门的所有子部门
|
||||||
/// <para>如果orgId为0,表示取得所有部门</para>
|
/// <para>如果orgId为0,表示取得所有部门</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IList<Org> LoadAllChildren(int orgId)
|
public IList<Org> LoadAllChildren(Guid orgId)
|
||||||
{
|
{
|
||||||
return _repository.GetSubOrgs(orgId).ToList();
|
return _repository.GetSubOrgs(orgId).ToList();
|
||||||
}
|
}
|
||||||
@@ -48,10 +48,10 @@ namespace OpenAuth.App
|
|||||||
/// <param name="org">The org.</param>
|
/// <param name="org">The org.</param>
|
||||||
/// <returns>System.Int32.</returns>
|
/// <returns>System.Int32.</returns>
|
||||||
/// <exception cref="System.Exception">未能找到该组织的父节点信息</exception>
|
/// <exception cref="System.Exception">未能找到该组织的父节点信息</exception>
|
||||||
public int AddOrUpdate(Org org)
|
public Guid AddOrUpdate(Org org)
|
||||||
{
|
{
|
||||||
ChangeModuleCascade(org);
|
ChangeModuleCascade(org);
|
||||||
if (org.Id == 0)
|
if (org.Id == Guid.Empty)
|
||||||
{
|
{
|
||||||
_repository.Add(org);
|
_repository.Add(org);
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除指定ID的部门及其所有子部门
|
/// 删除指定ID的部门及其所有子部门
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void DelOrg(int id)
|
public void DelOrg(Guid id)
|
||||||
{
|
{
|
||||||
var delOrg = _repository.FindSingle(u => u.Id == id);
|
var delOrg = _repository.FindSingle(u => u.Id == id);
|
||||||
if (delOrg == null) return;
|
if (delOrg == null) return;
|
||||||
@@ -80,7 +80,7 @@ namespace OpenAuth.App
|
|||||||
/// TODO:这里会加载用户及用户角色的所有角色,“为用户分配角色”功能会给人一种混乱的感觉,但可以接受
|
/// TODO:这里会加载用户及用户角色的所有角色,“为用户分配角色”功能会给人一种混乱的感觉,但可以接受
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId">The user unique identifier.</param>
|
/// <param name="userId">The user unique identifier.</param>
|
||||||
public List<Org> LoadForUser(int userId)
|
public List<Org> LoadForUser(Guid userId)
|
||||||
{
|
{
|
||||||
//用户角色
|
//用户角色
|
||||||
var userRoleIds =
|
var userRoleIds =
|
||||||
@@ -101,7 +101,7 @@ namespace OpenAuth.App
|
|||||||
/// 加载特定角色的角色
|
/// 加载特定角色的角色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="roleId">The role unique identifier.</param>
|
/// <param name="roleId">The role unique identifier.</param>
|
||||||
public List<Org> LoadForRole(int roleId)
|
public List<Org> LoadForRole(Guid roleId)
|
||||||
{
|
{
|
||||||
var moduleIds =
|
var moduleIds =
|
||||||
_relevanceRepository.Find(u => u.FirstId == roleId && u.Key == "RoleAccessedOrg")
|
_relevanceRepository.Find(u => u.FirstId == roleId && u.Key == "RoleAccessedOrg")
|
||||||
@@ -125,7 +125,7 @@ namespace OpenAuth.App
|
|||||||
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (org.ParentId != 0)
|
if (org.ParentId != Guid.Empty)
|
||||||
{
|
{
|
||||||
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
||||||
if (parentOrg != null)
|
if (parentOrg != null)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace OpenAuth.App
|
|||||||
_resManagerService = resManagerService;
|
_resManagerService = resManagerService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetResourceCntInOrg(int orgId)
|
public int GetResourceCntInOrg(Guid orgId)
|
||||||
{
|
{
|
||||||
return _resManagerService.GetResourceCntInOrg(orgId);
|
return _resManagerService.GetResourceCntInOrg(orgId);
|
||||||
}
|
}
|
||||||
@@ -32,14 +32,14 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载一个节点下面的一个或全部Resources
|
/// 加载一个节点下面的一个或全部Resources
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(string username, int categoryId, int pageindex, int pagesize)
|
public dynamic Load(string username, Guid categoryId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
return _resManagerService.Load(username, categoryId, pageindex, pagesize);
|
return _resManagerService.Load(username, categoryId, pageindex, pagesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
_resManagerService.Delete(id);
|
_resManagerService.Delete(id);
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ namespace OpenAuth.App
|
|||||||
/// 当为UserResource时,表示UserId
|
/// 当为UserResource时,表示UserId
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="cId">分类ID</param>
|
/// <param name="cId">分类ID</param>
|
||||||
public List<dynamic> LoadWithAccess(string username, string accessType, int firstId, int cId)
|
public List<dynamic> LoadWithAccess(string username, string accessType, Guid firstId, Guid cId)
|
||||||
{
|
{
|
||||||
return _resManagerService.LoadWithAccess(username, accessType, firstId, cId);
|
return _resManagerService.LoadWithAccess(username, accessType, firstId, cId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace OpenAuth.App
|
|||||||
/// <para>比如给用户分配资源,那么firstId就是用户ID,secIds就是资源ID列表</para>
|
/// <para>比如给用户分配资源,那么firstId就是用户ID,secIds就是资源ID列表</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type">关联的类型,如"UserResource"</param>
|
/// <param name="type">关联的类型,如"UserResource"</param>
|
||||||
public void Assign(string type, int firstId, int[] secIds)
|
public void Assign(string type, Guid firstId, Guid[] secIds)
|
||||||
{
|
{
|
||||||
_relevanceRepository.AddRelevance(type, secIds.ToLookup(u => firstId));
|
_relevanceRepository.AddRelevance(type, secIds.ToLookup(u => firstId));
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ namespace OpenAuth.App
|
|||||||
/// <param name="type">关联的类型,如"UserResource"</param>
|
/// <param name="type">关联的类型,如"UserResource"</param>
|
||||||
/// <param name="firstId">The first identifier.</param>
|
/// <param name="firstId">The first identifier.</param>
|
||||||
/// <param name="secIds">The sec ids.</param>
|
/// <param name="secIds">The sec ids.</param>
|
||||||
public void UnAssign(string type, int firstId, int[] secIds)
|
public void UnAssign(string type, Guid firstId, Guid[] secIds)
|
||||||
{
|
{
|
||||||
_relevanceRepository.DeleteBy(type, secIds.ToLookup(u =>firstId));
|
_relevanceRepository.DeleteBy(type, secIds.ToLookup(u =>firstId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using OpenAuth.Domain;
|
|||||||
using OpenAuth.Domain.Interface;
|
using OpenAuth.Domain.Interface;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Dynamic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.App
|
namespace OpenAuth.App
|
||||||
@@ -22,9 +23,9 @@ namespace OpenAuth.App
|
|||||||
_relevanceRepository = relevanceRepository;
|
_relevanceRepository = relevanceRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetRoleCntInOrg(int orgId)
|
public int GetRoleCntInOrg(Guid orgId)
|
||||||
{
|
{
|
||||||
if (orgId == 0)
|
if (orgId == Guid.Empty)
|
||||||
{
|
{
|
||||||
return _repository.Find(null).Count();
|
return _repository.Find(null).Count();
|
||||||
}
|
}
|
||||||
@@ -37,12 +38,12 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载一个部门及子部门全部Roles
|
/// 加载一个部门及子部门全部Roles
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(int orgId, int pageindex, int pagesize)
|
public dynamic Load(Guid orgId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
||||||
IEnumerable<Role> roles;
|
IEnumerable<Role> roles;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
if (orgId == 0)
|
if (orgId == Guid.Empty)
|
||||||
{
|
{
|
||||||
roles = _repository.LoadRoles(pageindex, pagesize);
|
roles = _repository.LoadRoles(pageindex, pagesize);
|
||||||
total = _repository.GetCount();
|
total = _repository.GetCount();
|
||||||
@@ -53,39 +54,39 @@ namespace OpenAuth.App
|
|||||||
total = _repository.GetRoleCntInOrgs(orgId);
|
total = _repository.GetRoleCntInOrgs(orgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new
|
dynamic result = new ExpandoObject();
|
||||||
{
|
result.total = total;
|
||||||
total = total,
|
result.list = roles.ToList();
|
||||||
list = roles,
|
result.pageCurrent = pageindex;
|
||||||
pageCurrent = pageindex
|
|
||||||
};
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取当前组织的所有下级组织
|
/// 获取当前组织的所有下级组织
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int[] GetSubOrgIds(int orgId)
|
private Guid[] GetSubOrgIds(Guid orgId)
|
||||||
{
|
{
|
||||||
var org = _orgRepository.FindSingle(u => u.Id == orgId);
|
var org = _orgRepository.FindSingle(u => u.Id == orgId);
|
||||||
var orgs = _orgRepository.Find(u => u.CascadeId.Contains(org.CascadeId)).Select(u => u.Id).ToArray();
|
var orgs = _orgRepository.Find(u => u.CascadeId.Contains(org.CascadeId)).Select(u => u.Id).ToArray();
|
||||||
return orgs;
|
return orgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Role Find(int id)
|
public Role Find(Guid id)
|
||||||
{
|
{
|
||||||
var role = _repository.FindSingle(u => u.Id == id);
|
var role = _repository.FindSingle(u => u.Id == id);
|
||||||
if (role == null) role = new Role();
|
if (role == null) role = new Role();
|
||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
_repository.Delete(id);
|
_repository.Delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddOrUpdate(Role role)
|
public void AddOrUpdate(Role role)
|
||||||
{
|
{
|
||||||
if (role.Id == 0)
|
if (role.Id == Guid.Empty)
|
||||||
{
|
{
|
||||||
role.CreateTime = DateTime.Now;
|
role.CreateTime = DateTime.Now;
|
||||||
_repository.Add(role);
|
_repository.Add(role);
|
||||||
@@ -96,10 +97,11 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RoleVM> LoadForOrgAndUser(int orgId, int userId)
|
public List<RoleVM> LoadForOrgAndUser(Guid orgId, Guid userId)
|
||||||
{
|
{
|
||||||
var allorgs = GetSubOrgIds(orgId);
|
var allorgs = GetSubOrgIds(orgId);
|
||||||
var roleIds = _repository.Find(u => orgId == 0 || allorgs.Contains(u.OrgId)).ToList();
|
var roleIds = _repository.Find(u => orgId == Guid.Empty
|
||||||
|
|| (u.OrgId != null &&allorgs.Contains(u.OrgId.Value))).ToList();
|
||||||
var rolevms = new List<RoleVM>();
|
var rolevms = new List<RoleVM>();
|
||||||
foreach (var role in roleIds)
|
foreach (var role in roleIds)
|
||||||
{
|
{
|
||||||
@@ -113,12 +115,12 @@ namespace OpenAuth.App
|
|||||||
return rolevms;
|
return rolevms;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AccessRole(int userId, int[] roleIds)
|
public void AccessRole(Guid userId, Guid[] roleIds)
|
||||||
{
|
{
|
||||||
_relevanceRepository.AddRelevance("UserRole", roleIds.ToLookup(roleId => userId));
|
_relevanceRepository.AddRelevance("UserRole", roleIds.ToLookup(roleId => userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DelAccessRole(int userId, int[] roleids)
|
public void DelAccessRole(Guid userId, Guid[] roleids)
|
||||||
{
|
{
|
||||||
_relevanceRepository.DeleteBy("UserRole", roleids.ToLookup(roleId => userId));
|
_relevanceRepository.DeleteBy("UserRole", roleids.ToLookup(roleId => userId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ using System.Web.Mvc;
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace OpenAuth.App.SSO
|
namespace OpenAuth.App.SSO
|
||||||
{
|
{
|
||||||
public class SSOAuthUtil
|
public class SSOAuthUtil
|
||||||
@@ -28,6 +30,7 @@ namespace OpenAuth.App.SSO
|
|||||||
{
|
{
|
||||||
userInfo = new User
|
userInfo = new User
|
||||||
{
|
{
|
||||||
|
Id = Guid.Empty,
|
||||||
Account = "System",
|
Account = "System",
|
||||||
Name ="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա",
|
Name ="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա",
|
||||||
Password = "123456"
|
Password = "123456"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using OpenAuth.Domain;
|
using System;
|
||||||
|
using OpenAuth.Domain;
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using OpenAuth.Domain.Service;
|
using OpenAuth.Domain.Service;
|
||||||
|
|
||||||
@@ -16,12 +17,12 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据部门ID得到进出库信息
|
/// 根据部门ID得到进出库信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(string username, int orgId, int pageindex, int pagesize)
|
public dynamic Load(string username, Guid orgId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
return _service.Load(username, orgId, pageindex, pagesize);
|
return _service.Load(username, orgId, pageindex, pagesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
_service.Delete(id);
|
_service.Delete(id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
|
||||||
namespace OpenAuth.App
|
namespace OpenAuth.App
|
||||||
{
|
{
|
||||||
public class UserManagerApp
|
public class UserManagerApp
|
||||||
@@ -27,9 +28,9 @@ namespace OpenAuth.App
|
|||||||
return _repository.FindSingle(u => u.Account == account);
|
return _repository.FindSingle(u => u.Account == account);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetUserCntInOrg(int orgId)
|
public int GetUserCntInOrg(Guid orgId)
|
||||||
{
|
{
|
||||||
if (orgId == 0)
|
if (orgId == Guid.Empty)
|
||||||
{
|
{
|
||||||
return _repository.Find(null).Count();
|
return _repository.Find(null).Count();
|
||||||
}
|
}
|
||||||
@@ -42,12 +43,12 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载一个部门及子部门全部用户
|
/// 加载一个部门及子部门全部用户
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(int orgId, int pageindex, int pagesize)
|
public dynamic Load(Guid orgId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
||||||
IEnumerable<User> users;
|
IEnumerable<User> users;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
if (orgId == 0)
|
if (orgId ==Guid.Empty)
|
||||||
{
|
{
|
||||||
users = _repository.LoadUsers(pageindex, pagesize);
|
users = _repository.LoadUsers(pageindex, pagesize);
|
||||||
total = _repository.GetCount();
|
total = _repository.GetCount();
|
||||||
@@ -79,14 +80,14 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取当前组织的所有下级组织
|
/// 获取当前组织的所有下级组织
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int[] GetSubOrgIds(int orgId)
|
private Guid[] GetSubOrgIds(Guid orgId)
|
||||||
{
|
{
|
||||||
var org = _orgRepository.FindSingle(u => u.Id == orgId);
|
var org = _orgRepository.FindSingle(u => u.Id == orgId);
|
||||||
var orgs = _orgRepository.Find(u => u.CascadeId.Contains(org.CascadeId)).Select(u => u.Id).ToArray();
|
var orgs = _orgRepository.Find(u => u.CascadeId.Contains(org.CascadeId)).Select(u => u.Id).ToArray();
|
||||||
return orgs;
|
return orgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserView Find(int id)
|
public UserView Find(Guid id)
|
||||||
{
|
{
|
||||||
var user = _repository.FindSingle(u => u.Id == id);
|
var user = _repository.FindSingle(u => u.Id == id);
|
||||||
if (user == null) return new UserView();
|
if (user == null) return new UserView();
|
||||||
@@ -102,7 +103,7 @@ namespace OpenAuth.App
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
_repository.Delete(u => u.Id == id);
|
_repository.Delete(u => u.Id == id);
|
||||||
_relevanceRepository.DeleteBy("UserOrg", id);
|
_relevanceRepository.DeleteBy("UserOrg", id);
|
||||||
@@ -113,7 +114,7 @@ namespace OpenAuth.App
|
|||||||
public void AddOrUpdate(UserView view)
|
public void AddOrUpdate(UserView view)
|
||||||
{
|
{
|
||||||
User user = view;
|
User user = view;
|
||||||
if (user.Id == 0)
|
if (user.Id == Guid.Empty)
|
||||||
{
|
{
|
||||||
if (_repository.IsExist(u => u.Account == view.Account))
|
if (_repository.IsExist(u => u.Account == view.Account))
|
||||||
{
|
{
|
||||||
@@ -130,14 +131,13 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
Account = user.Account,
|
Account = user.Account,
|
||||||
BizCode = user.BizCode,
|
BizCode = user.BizCode,
|
||||||
CreateId = user.CreateId,
|
|
||||||
Name = user.Name,
|
Name = user.Name,
|
||||||
Sex = user.Sex,
|
Sex = user.Sex,
|
||||||
Status = user.Status,
|
Status = user.Status,
|
||||||
Type = user.Type
|
Type = user.Type
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
int[] orgIds = view.OrganizationIds.Split(',').Select(id => int.Parse(id)).ToArray();
|
Guid[] orgIds = view.OrganizationIds.Split(',').Select(id => Guid.Parse(id)).ToArray();
|
||||||
|
|
||||||
_relevanceRepository.DeleteBy("UserOrg", user.Id);
|
_relevanceRepository.DeleteBy("UserOrg", user.Id);
|
||||||
_relevanceRepository.AddRelevance("UserOrg", orgIds.ToLookup(u => user.Id));
|
_relevanceRepository.AddRelevance("UserOrg", orgIds.ToLookup(u => user.Id));
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Infrastructure;
|
using System;
|
||||||
|
using Infrastructure;
|
||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ namespace OpenAuth.App.ViewModel
|
|||||||
/// ID
|
/// ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 组织名称
|
/// 组织名称
|
||||||
@@ -28,7 +29,7 @@ namespace OpenAuth.App.ViewModel
|
|||||||
/// 父节点流水号
|
/// 父节点流水号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int ParentId { get; set; }
|
public Guid? ParentId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 节点图标文件名称
|
/// 节点图标文件名称
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace OpenAuth.App.ViewModel
|
|||||||
/// 用户ID
|
/// 用户ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
|
|
||||||
|
|
||||||
namespace OpenAuth.App.ViewModel
|
namespace OpenAuth.App.ViewModel
|
||||||
{
|
{
|
||||||
public class UserView
|
public class UserView
|
||||||
@@ -11,7 +12,7 @@ namespace OpenAuth.App.ViewModel
|
|||||||
/// 用户ID
|
/// 用户ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
|
|
||||||
|
|
||||||
namespace OpenAuth.App.ViewModel
|
namespace OpenAuth.App.ViewModel
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -7,33 +7,26 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分类表
|
/// 分类表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Category
|
public partial class Category :Entity
|
||||||
{
|
{
|
||||||
public Category()
|
public Category()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
|
||||||
this.CascadeId= string.Empty;
|
this.CascadeId= string.Empty;
|
||||||
this.Name= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.ParentId= 0;
|
|
||||||
this.Status= 0;
|
this.Status= 0;
|
||||||
this.SortNo= 0;
|
this.SortNo= 0;
|
||||||
this.RootKey= string.Empty;
|
this.RootKey= string.Empty;
|
||||||
this.RootName= string.Empty;
|
this.RootName= string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 分类表ID
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 节点语义ID
|
/// 节点语义ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -42,10 +35,6 @@ namespace OpenAuth.Domain
|
|||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 父节点流水号
|
|
||||||
/// </summary>
|
|
||||||
public int ParentId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当前状态
|
/// 当前状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -62,6 +51,10 @@ namespace OpenAuth.Domain
|
|||||||
/// 分类所属科目名称
|
/// 分类所属科目名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string RootName { get; set; }
|
public string RootName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 父节点流水号
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid? ParentId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,32 +7,25 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据字典详情
|
/// 数据字典详情
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class DicDetail
|
public partial class DicDetail :Entity
|
||||||
{
|
{
|
||||||
public DicDetail()
|
public DicDetail()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.Value= string.Empty;
|
||||||
this.Value= string.Empty;
|
|
||||||
this.Text= string.Empty;
|
this.Text= string.Empty;
|
||||||
this.DicId= 0;
|
|
||||||
this.SortNo= 0;
|
this.SortNo= 0;
|
||||||
this.Status= 0;
|
this.Status= 0;
|
||||||
this.Description= string.Empty;
|
this.Description= string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ID
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 值
|
/// 值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -41,10 +34,6 @@ namespace OpenAuth.Domain
|
|||||||
/// 文本描述
|
/// 文本描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 所属字典ID
|
|
||||||
/// </summary>
|
|
||||||
public int DicId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 排序号
|
/// 排序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -57,6 +46,10 @@ namespace OpenAuth.Domain
|
|||||||
/// 描述
|
/// 描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 所属字典ID
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid DicId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,31 +7,24 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据字典
|
/// 数据字典
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class DicIndex
|
public partial class DicIndex :Entity
|
||||||
{
|
{
|
||||||
public DicIndex()
|
public DicIndex()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.Name= string.Empty;
|
||||||
this.Name= string.Empty;
|
|
||||||
this.Key= string.Empty;
|
this.Key= string.Empty;
|
||||||
this.SortNo= 0;
|
this.SortNo= 0;
|
||||||
this.CategoryId= 0;
|
|
||||||
this.Description= string.Empty;
|
this.Description= string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据字典ID
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -44,14 +37,14 @@ namespace OpenAuth.Domain
|
|||||||
/// 排序号
|
/// 排序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SortNo { get; set; }
|
public int SortNo { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 所属分类
|
|
||||||
/// </summary>
|
|
||||||
public int CategoryId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述
|
/// 描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 所属分类
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid? CategoryId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
14
OpenAuth.Domain/Entity.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace OpenAuth.Domain
|
||||||
|
{
|
||||||
|
public abstract class Entity
|
||||||
|
{
|
||||||
|
public System.Guid Id { get; set; }
|
||||||
|
|
||||||
|
public Entity()
|
||||||
|
{
|
||||||
|
Id = Guid.NewGuid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,56 +7,58 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 键值参数
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Param
|
public partial class GoodsApply : Entity
|
||||||
{
|
{
|
||||||
public Param()
|
public GoodsApply()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.Sort= 0;
|
||||||
this.Value= string.Empty;
|
this.Number= 0;
|
||||||
this.Key= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.CategoryId= 0;
|
this.Comment= string.Empty;
|
||||||
this.SortNo= 0;
|
this.State= string.Empty;
|
||||||
this.Status= 0;
|
this.StateName= string.Empty;
|
||||||
this.Description= string.Empty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Sort { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 值
|
|
||||||
/// </summary>
|
|
||||||
public string Value { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Key { get; set; }
|
public int Number { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属分类
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CategoryId { get; set; }
|
public string Name { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 排序号
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SortNo { get; set; }
|
public string Comment { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 状态
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Status { get; set; }
|
public string State { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Description { get; set; }
|
public string StateName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid UserId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid? ControllerUserId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Interface
|
namespace OpenAuth.Domain.Interface
|
||||||
@@ -7,11 +8,11 @@ namespace OpenAuth.Domain.Interface
|
|||||||
{
|
{
|
||||||
IEnumerable<Category> LoadCategorys(int pageindex, int pagesize);
|
IEnumerable<Category> LoadCategorys(int pageindex, int pagesize);
|
||||||
|
|
||||||
IEnumerable<Category> LoadInOrgs(params int[] orgId);
|
IEnumerable<Category> LoadInOrgs(params Guid[] orgId);
|
||||||
int GetCategoryCntInOrgs(params int[] orgIds);
|
int GetCategoryCntInOrgs(params Guid[] orgIds);
|
||||||
IEnumerable<Category> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds);
|
IEnumerable<Category> LoadInOrgs(int pageindex, int pagesize, params Guid[] orgIds);
|
||||||
|
|
||||||
void Delete(int id);
|
void Delete(Guid id);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Interface
|
namespace OpenAuth.Domain.Interface
|
||||||
@@ -7,12 +8,12 @@ namespace OpenAuth.Domain.Interface
|
|||||||
{
|
{
|
||||||
IEnumerable<Module> LoadModules(int pageindex, int pagesize);
|
IEnumerable<Module> LoadModules(int pageindex, int pagesize);
|
||||||
|
|
||||||
IEnumerable<Module> LoadInOrgs(params int[] orgId);
|
IEnumerable<Module> LoadInOrgs(params Guid[] orgId);
|
||||||
int GetModuleCntInOrgs(params int[] orgIds);
|
int GetModuleCntInOrgs(params Guid[] orgIds);
|
||||||
IEnumerable<Module> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds);
|
IEnumerable<Module> LoadInOrgs(int pageindex, int pagesize, params Guid[] orgIds);
|
||||||
|
|
||||||
|
|
||||||
void Delete(int id);
|
void Delete(Guid id);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,19 +10,19 @@ namespace OpenAuth.Domain.Interface
|
|||||||
{
|
{
|
||||||
IEnumerable<Org> LoadOrgs();
|
IEnumerable<Org> LoadOrgs();
|
||||||
|
|
||||||
IEnumerable<Org> LoadByUser(int userId);
|
IEnumerable<Org> LoadByUser(Guid userId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 得到全部子部门
|
/// 得到全部子部门
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="orgId">部门ID</param>
|
/// <param name="orgId">部门ID</param>
|
||||||
IEnumerable<Org> GetSubOrgs(int orgId);
|
IEnumerable<Org> GetSubOrgs(Guid orgId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取包括自己在内的全部子部门
|
/// 获取包括自己在内的全部子部门
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="orgId">The org identifier.</param>
|
/// <param name="orgId">The org identifier.</param>
|
||||||
/// <returns>IEnumerable<Org>.</returns>
|
/// <returns>IEnumerable<Org>.</returns>
|
||||||
IEnumerable<Org> GetSubWithOwn(int orgId);
|
IEnumerable<Org> GetSubWithOwn(Guid orgId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
// <summary>多对多关系统一处理</summary>
|
// <summary>多对多关系统一处理</summary>
|
||||||
// ***********************************************************************
|
// ***********************************************************************
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@@ -19,9 +20,9 @@ namespace OpenAuth.Domain.Interface
|
|||||||
{
|
{
|
||||||
public interface IRelevanceRepository : IRepository<Relevance>
|
public interface IRelevanceRepository : IRepository<Relevance>
|
||||||
{
|
{
|
||||||
void DeleteBy(string key, params int[] firstIds);
|
void DeleteBy(string key, params Guid[] firstIds);
|
||||||
void DeleteBy(string key, ILookup<int, int> idMaps);
|
void DeleteBy(string key, ILookup<Guid, Guid> idMaps);
|
||||||
|
|
||||||
void AddRelevance( string key, ILookup<int, int> idMaps);
|
void AddRelevance( string key, ILookup<Guid, Guid> idMaps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Interface
|
namespace OpenAuth.Domain.Interface
|
||||||
@@ -7,11 +8,11 @@ namespace OpenAuth.Domain.Interface
|
|||||||
{
|
{
|
||||||
IEnumerable<Resource> LoadResources(int pageindex, int pagesize);
|
IEnumerable<Resource> LoadResources(int pageindex, int pagesize);
|
||||||
|
|
||||||
IEnumerable<Resource> LoadInOrgs(params int[] orgId);
|
IEnumerable<Resource> LoadInOrgs(params Guid[] orgId);
|
||||||
int GetResourceCntInOrgs(params int[] orgIds);
|
int GetResourceCntInOrgs(params Guid[] orgIds);
|
||||||
IEnumerable<Resource> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds);
|
IEnumerable<Resource> LoadInOrgs(int pageindex, int pagesize, params Guid[] orgIds);
|
||||||
|
|
||||||
void Delete(int id);
|
void Delete(Guid id);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Interface
|
namespace OpenAuth.Domain.Interface
|
||||||
@@ -7,10 +8,10 @@ namespace OpenAuth.Domain.Interface
|
|||||||
{
|
{
|
||||||
IEnumerable<Role> LoadRoles(int pageindex, int pagesize);
|
IEnumerable<Role> LoadRoles(int pageindex, int pagesize);
|
||||||
|
|
||||||
int GetRoleCntInOrgs(params int[] orgIds);
|
int GetRoleCntInOrgs(params Guid[] orgIds);
|
||||||
IEnumerable<Role> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds);
|
IEnumerable<Role> LoadInOrgs(int pageindex, int pagesize, params Guid[] orgIds);
|
||||||
|
|
||||||
void Delete(int id);
|
void Delete(Guid id);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Interface
|
namespace OpenAuth.Domain.Interface
|
||||||
@@ -7,11 +8,11 @@ namespace OpenAuth.Domain.Interface
|
|||||||
{
|
{
|
||||||
IEnumerable<Stock> LoadStocks(int pageindex, int pagesize);
|
IEnumerable<Stock> LoadStocks(int pageindex, int pagesize);
|
||||||
|
|
||||||
IEnumerable<Stock> LoadInOrgs(params int[] orgId);
|
IEnumerable<Stock> LoadInOrgs(params Guid[] orgId);
|
||||||
int GetStockCntInOrgs(params int[] orgIds);
|
int GetStockCntInOrgs(params Guid[] orgIds);
|
||||||
IEnumerable<Stock> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds);
|
IEnumerable<Stock> LoadInOrgs(int pageindex, int pagesize, params Guid[] orgIds);
|
||||||
|
|
||||||
void Delete(int id);
|
void Delete(Guid id);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,9 +33,9 @@ namespace OpenAuth.Domain.Interface
|
|||||||
|
|
||||||
int GetCount<T>(Expression<Func<T, bool>> exp = null) where T:class;
|
int GetCount<T>(Expression<Func<T, bool>> exp = null) where T:class;
|
||||||
|
|
||||||
void Add<T>(T entity) where T:class;
|
void Add<T>(T entity) where T:Entity;
|
||||||
|
|
||||||
void BatchAdd<T>(T[] entities) where T:class;
|
void BatchAdd<T>(T[] entities) where T:Entity;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 更新一个实体的所有属性
|
/// 更新一个实体的所有属性
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Interface
|
namespace OpenAuth.Domain.Interface
|
||||||
@@ -7,9 +8,9 @@ namespace OpenAuth.Domain.Interface
|
|||||||
{
|
{
|
||||||
IEnumerable<User> LoadUsers(int pageindex, int pagesize);
|
IEnumerable<User> LoadUsers(int pageindex, int pagesize);
|
||||||
|
|
||||||
IEnumerable<User> LoadInOrgs(params int[] orgId);
|
IEnumerable<User> LoadInOrgs(params Guid[] orgId);
|
||||||
int GetUserCntInOrgs(params int[] orgIds);
|
int GetUserCntInOrgs(params Guid[] orgIds);
|
||||||
IEnumerable<User> LoadInOrgs(int pageindex, int pagesize, params int[] orgIds);
|
IEnumerable<User> LoadInOrgs(int pageindex, int pagesize, params Guid[] orgIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,25 +7,22 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 功能模块表
|
/// 功能模块表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Module
|
public partial class Module:Entity
|
||||||
{
|
{
|
||||||
public Module()
|
public Module()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.CascadeId= string.Empty;
|
||||||
this.CascadeId= string.Empty;
|
|
||||||
this.Name= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.Url= string.Empty;
|
this.Url= string.Empty;
|
||||||
this.HotKey= string.Empty;
|
this.HotKey= string.Empty;
|
||||||
this.ParentId= 0;
|
|
||||||
this.IconName= string.Empty;
|
this.IconName= string.Empty;
|
||||||
this.Status= 0;
|
this.Status= 0;
|
||||||
this.ParentName= string.Empty;
|
this.ParentName= string.Empty;
|
||||||
@@ -33,10 +30,6 @@ namespace OpenAuth.Domain
|
|||||||
this.SortNo= 0;
|
this.SortNo= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 功能模块流水号
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 节点语义ID
|
/// 节点语义ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -56,7 +49,7 @@ namespace OpenAuth.Domain
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 父节点流水号
|
/// 父节点流水号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ParentId { get; set; }
|
public Guid? ParentId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否叶子节点
|
/// 是否叶子节点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -7,24 +7,21 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模块元素表(需要权限控制的按钮)
|
/// 模块元素表(需要权限控制的按钮)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ModuleElement
|
public partial class ModuleElement :Entity
|
||||||
{
|
{
|
||||||
public ModuleElement()
|
public ModuleElement()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.DomId= string.Empty;
|
||||||
this.DomId= string.Empty;
|
|
||||||
this.Name= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.Type= string.Empty;
|
this.Type= string.Empty;
|
||||||
this.ModuleId= 0;
|
|
||||||
this.Attr= string.Empty;
|
this.Attr= string.Empty;
|
||||||
this.Script= string.Empty;
|
this.Script= string.Empty;
|
||||||
this.Icon= string.Empty;
|
this.Icon= string.Empty;
|
||||||
@@ -33,10 +30,6 @@ namespace OpenAuth.Domain
|
|||||||
this.Sort= 0;
|
this.Sort= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 流水号
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DOM ID
|
/// DOM ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -49,10 +42,6 @@ namespace OpenAuth.Domain
|
|||||||
/// 类型
|
/// 类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 功能模块Id
|
|
||||||
/// </summary>
|
|
||||||
public int ModuleId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 元素附加属性
|
/// 元素附加属性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -77,6 +66,10 @@ namespace OpenAuth.Domain
|
|||||||
/// 排序字段
|
/// 排序字段
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Sort { get; set; }
|
public int Sort { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid ModuleId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,6 +46,8 @@
|
|||||||
<Compile Include="Core\User.cs" />
|
<Compile Include="Core\User.cs" />
|
||||||
<Compile Include="DicDetail.cs" />
|
<Compile Include="DicDetail.cs" />
|
||||||
<Compile Include="DicIndex.cs" />
|
<Compile Include="DicIndex.cs" />
|
||||||
|
<Compile Include="Entity.cs" />
|
||||||
|
<Compile Include="GoodsApply.cs" />
|
||||||
<Compile Include="Interface\ICategoryRepository.cs" />
|
<Compile Include="Interface\ICategoryRepository.cs" />
|
||||||
<Compile Include="Interface\IModuleRepository.cs" />
|
<Compile Include="Interface\IModuleRepository.cs" />
|
||||||
<Compile Include="Interface\IOrgRepository.cs" />
|
<Compile Include="Interface\IOrgRepository.cs" />
|
||||||
@@ -59,7 +61,6 @@
|
|||||||
<Compile Include="Module.cs" />
|
<Compile Include="Module.cs" />
|
||||||
<Compile Include="ModuleElement.cs" />
|
<Compile Include="ModuleElement.cs" />
|
||||||
<Compile Include="Org.cs" />
|
<Compile Include="Org.cs" />
|
||||||
<Compile Include="Param.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Relevance.cs" />
|
<Compile Include="Relevance.cs" />
|
||||||
<Compile Include="Resource.cs" />
|
<Compile Include="Resource.cs" />
|
||||||
@@ -71,8 +72,6 @@
|
|||||||
<Compile Include="Service\StockManagerService.cs" />
|
<Compile Include="Service\StockManagerService.cs" />
|
||||||
<Compile Include="Stock.cs" />
|
<Compile Include="Stock.cs" />
|
||||||
<Compile Include="User.cs" />
|
<Compile Include="User.cs" />
|
||||||
<Compile Include="UserCfg.cs" />
|
|
||||||
<Compile Include="UserExt.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|||||||
@@ -7,24 +7,21 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 组织表
|
/// 组织表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Org
|
public partial class Org:Entity
|
||||||
{
|
{
|
||||||
public Org()
|
public Org()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.CascadeId= string.Empty;
|
||||||
this.CascadeId= string.Empty;
|
|
||||||
this.Name= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.HotKey= string.Empty;
|
this.HotKey= string.Empty;
|
||||||
this.ParentId= 0;
|
|
||||||
this.ParentName= string.Empty;
|
this.ParentName= string.Empty;
|
||||||
this.IconName= string.Empty;
|
this.IconName= string.Empty;
|
||||||
this.Status= 0;
|
this.Status= 0;
|
||||||
@@ -36,10 +33,6 @@ namespace OpenAuth.Domain
|
|||||||
this.SortNo= 0;
|
this.SortNo= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 流水号
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 节点语义ID
|
/// 节点语义ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -52,10 +45,6 @@ namespace OpenAuth.Domain
|
|||||||
/// 热键
|
/// 热键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HotKey { get; set; }
|
public string HotKey { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 父节点流水号
|
|
||||||
/// </summary>
|
|
||||||
public int ParentId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 父节点名称
|
/// 父节点名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -100,6 +89,10 @@ namespace OpenAuth.Domain
|
|||||||
/// 排序号
|
/// 排序号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SortNo { get; set; }
|
public int SortNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 父节点流水号
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid? ParentId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,41 +7,25 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 多对多关系集中映射
|
/// 多对多关系集中映射
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Relevance
|
public partial class Relevance :Entity
|
||||||
{
|
{
|
||||||
public Relevance()
|
public Relevance()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.Description= string.Empty;
|
||||||
this.FirstId= 0;
|
|
||||||
this.SecondId= 0;
|
|
||||||
this.Description= string.Empty;
|
|
||||||
this.Key= string.Empty;
|
this.Key= string.Empty;
|
||||||
this.Status= 0;
|
this.Status= 0;
|
||||||
this.OperateTime= DateTime.Now;
|
this.OperateTime= DateTime.Now;
|
||||||
this.OperatorId= 0;
|
this.OperatorId= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 流水号
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 第一个表主键ID
|
|
||||||
/// </summary>
|
|
||||||
public int FirstId { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 第二个表主键ID
|
|
||||||
/// </summary>
|
|
||||||
public int SecondId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述
|
/// 描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -62,6 +46,14 @@ namespace OpenAuth.Domain
|
|||||||
/// 授权人
|
/// 授权人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int OperatorId { get; set; }
|
public int OperatorId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 第一个表主键ID
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid FirstId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 第二个表主键ID
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid SecondId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,34 +7,26 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源表
|
/// 资源表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Resource
|
public partial class Resource :Entity
|
||||||
{
|
{
|
||||||
public Resource()
|
public Resource()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.CascadeId= string.Empty;
|
||||||
this.CascadeId= string.Empty;
|
|
||||||
this.Key= string.Empty;
|
this.Key= string.Empty;
|
||||||
this.Name= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.ParentId= 0;
|
|
||||||
this.Status= 0;
|
this.Status= 0;
|
||||||
this.SortNo= 0;
|
this.SortNo= 0;
|
||||||
this.CategoryId= 0;
|
|
||||||
this.Description= string.Empty;
|
this.Description= string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 资源表ID
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 节点语义ID
|
/// 节点语义ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -47,10 +39,6 @@ namespace OpenAuth.Domain
|
|||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 父节点流水号
|
|
||||||
/// </summary>
|
|
||||||
public int ParentId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当前状态
|
/// 当前状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -62,11 +50,15 @@ namespace OpenAuth.Domain
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源分类
|
/// 资源分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CategoryId { get; set; }
|
public Guid? CategoryId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述
|
/// 描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 父节点流水号
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid? ParentId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,34 +7,27 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色表
|
/// 角色表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Role
|
public partial class Role :Entity
|
||||||
{
|
{
|
||||||
public Role()
|
public Role()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.Name= string.Empty;
|
||||||
this.Name= string.Empty;
|
|
||||||
this.Status= 0;
|
this.Status= 0;
|
||||||
this.Type= 0;
|
this.Type= 0;
|
||||||
this.CreateTime= DateTime.Now;
|
this.CreateTime= DateTime.Now;
|
||||||
this.CreateId= string.Empty;
|
this.CreateId= string.Empty;
|
||||||
this.OrgId= 0;
|
|
||||||
this.OrgCascadeId= string.Empty;
|
this.OrgCascadeId= string.Empty;
|
||||||
this.OrgName= string.Empty;
|
this.OrgName= string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 流水号
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色名称
|
/// 角色名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -55,10 +48,6 @@ namespace OpenAuth.Domain
|
|||||||
/// 创建人ID
|
/// 创建人ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CreateId { get; set; }
|
public string CreateId { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 所属部门流水号
|
|
||||||
/// </summary>
|
|
||||||
public int OrgId { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属部门节点语义ID
|
/// 所属部门节点语义ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -67,6 +56,10 @@ namespace OpenAuth.Domain
|
|||||||
/// 所属部门名称
|
/// 所属部门名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OrgName { get; set; }
|
public string OrgName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 所属部门流水号
|
||||||
|
/// </summary>
|
||||||
|
public System.Guid? OrgId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
// ***********************************************************************
|
// ***********************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenAuth.Domain.Interface;
|
using OpenAuth.Domain.Interface;
|
||||||
@@ -33,7 +34,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
|
|
||||||
public void AddOrUpdate(ModuleElement model)
|
public void AddOrUpdate(ModuleElement model)
|
||||||
{
|
{
|
||||||
if (model.Id == 0)
|
if (model.Id == Guid.Empty)
|
||||||
{
|
{
|
||||||
_unitWork.Add(model);
|
_unitWork.Add(model);
|
||||||
}
|
}
|
||||||
@@ -45,7 +46,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
_unitWork.Save();
|
_unitWork.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<ModuleElement> LoadByModuleId(string loginuser, int id)
|
public IEnumerable<ModuleElement> LoadByModuleId(string loginuser, Guid id)
|
||||||
{
|
{
|
||||||
_authoriseService.LoadAuthControls(loginuser);
|
_authoriseService.LoadAuthControls(loginuser);
|
||||||
if (_authoriseService.ModuleElements.Count == 0) //用户没有任何资源
|
if (_authoriseService.ModuleElements.Count == 0) //用户没有任何资源
|
||||||
@@ -67,7 +68,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
/// 当为UserElement时,表示UserId
|
/// 当为UserElement时,表示UserId
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="moduleId">模块ID</param>
|
/// <param name="moduleId">模块ID</param>
|
||||||
public List<dynamic> LoadWithAccess(string username, string accessType, int firstId, int moduleId)
|
public List<dynamic> LoadWithAccess(string username, string accessType, Guid firstId, Guid moduleId)
|
||||||
{
|
{
|
||||||
var listVms = new List<dynamic>();
|
var listVms = new List<dynamic>();
|
||||||
_authoriseService.LoadAuthControls(username);
|
_authoriseService.LoadAuthControls(username);
|
||||||
@@ -76,7 +77,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
return listVms;
|
return listVms;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moduleId == 0) return listVms;
|
if (moduleId == Guid.Empty) return listVms;
|
||||||
string modulename = _authoriseService.Modules.SingleOrDefault(u => u.Id == moduleId).Name;
|
string modulename = _authoriseService.Modules.SingleOrDefault(u => u.Id == moduleId).Name;
|
||||||
|
|
||||||
foreach (var element in _authoriseService.ModuleElements.Where(u =>u.ModuleId ==moduleId))
|
foreach (var element in _authoriseService.ModuleElements.Where(u =>u.ModuleId ==moduleId))
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载一个节点下面的所有
|
/// 加载一个节点下面的所有
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(string loginuser, int parentId, int pageindex, int pagesize)
|
public dynamic Load(string loginuser, Guid parentId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
|
|
||||||
_authoriseService.LoadAuthControls(loginuser);
|
_authoriseService.LoadAuthControls(loginuser);
|
||||||
@@ -51,7 +51,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
var ids = GetSubIds(parentId);
|
var ids = GetSubIds(parentId);
|
||||||
var query = _authoriseService.Modules.Where(u => parentId == 0 || ids.Contains(u.ParentId));
|
var query = _authoriseService.Modules.Where(u => parentId == Guid.Empty || (u.ParentId != null&&ids.Contains(u.ParentId.Value)));
|
||||||
|
|
||||||
int total = query.Count();
|
int total = query.Count();
|
||||||
var modules = query.OrderBy(u=>u.CascadeId).Skip((pageindex - 1)*pagesize).Take(pagesize);
|
var modules = query.OrderBy(u=>u.CascadeId).Skip((pageindex - 1)*pagesize).Take(pagesize);
|
||||||
@@ -64,7 +64,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
var del = _repository.FindSingle(u => u.Id == id);
|
var del = _repository.FindSingle(u => u.Id == id);
|
||||||
if (del == null) return;
|
if (del == null) return;
|
||||||
@@ -75,7 +75,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
public void AddOrUpdate(Module model)
|
public void AddOrUpdate(Module model)
|
||||||
{
|
{
|
||||||
ChangeModuleCascade(model);
|
ChangeModuleCascade(model);
|
||||||
if (model.Id == 0)
|
if (model.Id == Guid.Empty)
|
||||||
{
|
{
|
||||||
_repository.Add(model);
|
_repository.Add(model);
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
/// 加载特定用户的模块
|
/// 加载特定用户的模块
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId">The user unique identifier.</param>
|
/// <param name="userId">The user unique identifier.</param>
|
||||||
public List<Module> LoadForUser(int userId)
|
public List<Module> LoadForUser(Guid userId)
|
||||||
{
|
{
|
||||||
//用户角色
|
//用户角色
|
||||||
var userRoleIds =
|
var userRoleIds =
|
||||||
@@ -116,7 +116,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
/// 加载特定角色的模块
|
/// 加载特定角色的模块
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="roleId">The role unique identifier.</param>
|
/// <param name="roleId">The role unique identifier.</param>
|
||||||
public List<Module> LoadForRole(int roleId)
|
public List<Module> LoadForRole(Guid roleId)
|
||||||
{
|
{
|
||||||
var moduleIds =
|
var moduleIds =
|
||||||
_relevanceRepository.Find(u => u.FirstId == roleId && u.Key == "RoleModule")
|
_relevanceRepository.Find(u => u.FirstId == roleId && u.Key == "RoleModule")
|
||||||
@@ -132,9 +132,9 @@ namespace OpenAuth.Domain.Service
|
|||||||
|
|
||||||
//根据同一级中最大的语义ID
|
//根据同一级中最大的语义ID
|
||||||
|
|
||||||
private int[] GetSubIds(int parentId)
|
private Guid[] GetSubIds(Guid parentId)
|
||||||
{
|
{
|
||||||
if (parentId == 0) return _repository.Find(null).Select(u => u.Id).ToArray();
|
if (parentId == Guid.Empty) return _repository.Find(null).Select(u => u.Id).ToArray();
|
||||||
var parent = _repository.FindSingle(u => u.Id == parentId);
|
var parent = _repository.FindSingle(u => u.Id == parentId);
|
||||||
var orgs = _repository.Find(u => u.CascadeId.Contains(parent.CascadeId)).Select(u => u.Id).ToArray();
|
var orgs = _repository.Find(u => u.CascadeId.Contains(parent.CascadeId)).Select(u => u.Id).ToArray();
|
||||||
return orgs;
|
return orgs;
|
||||||
@@ -152,7 +152,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (module.ParentId != 0)
|
if (module.ParentId != null)
|
||||||
{
|
{
|
||||||
var parentOrg = _repository.FindSingle(o => o.Id == module.ParentId);
|
var parentOrg = _repository.FindSingle(o => o.Id == module.ParentId);
|
||||||
if (parentOrg != null)
|
if (parentOrg != null)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenAuth.Domain.Interface;
|
using OpenAuth.Domain.Interface;
|
||||||
|
|
||||||
@@ -26,9 +27,9 @@ namespace OpenAuth.Domain.Service
|
|||||||
_authoriseService = authoriseService;
|
_authoriseService = authoriseService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetResourceCntInOrg(int orgId)
|
public int GetResourceCntInOrg(Guid orgId)
|
||||||
{
|
{
|
||||||
if (orgId == 0)
|
if (orgId == Guid.Empty)
|
||||||
{
|
{
|
||||||
return _repository.Find(null).Count();
|
return _repository.Find(null).Count();
|
||||||
}
|
}
|
||||||
@@ -46,7 +47,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载用户一个节点下面的一个或全部Resources
|
/// 加载用户一个节点下面的一个或全部Resources
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(string username, int categoryId, int pageindex, int pagesize)
|
public dynamic Load(string username, Guid categoryId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
_authoriseService.LoadAuthControls(username);
|
_authoriseService.LoadAuthControls(username);
|
||||||
if (_authoriseService.Resources.Count == 0) //用户没有任何资源
|
if (_authoriseService.Resources.Count == 0) //用户没有任何资源
|
||||||
@@ -58,7 +59,8 @@ namespace OpenAuth.Domain.Service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
var subIds = GetSubOrgIds(categoryId);
|
var subIds = GetSubOrgIds(categoryId);
|
||||||
var query = _authoriseService.Resources.Where(u => categoryId == 0 || subIds.Contains(u.CategoryId));
|
var query = _authoriseService.Resources.Where(u => categoryId == Guid.Empty ||
|
||||||
|
(u.CategoryId != null && subIds.Contains(u.CategoryId.Value)));
|
||||||
var Resources = query.Skip((pageindex - 1) * pagesize).Take(pagesize);
|
var Resources = query.Skip((pageindex - 1) * pagesize).Take(pagesize);
|
||||||
int total = query.Count();
|
int total = query.Count();
|
||||||
|
|
||||||
@@ -73,9 +75,9 @@ namespace OpenAuth.Domain.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取当前节点的所有下级节点
|
/// 获取当前节点的所有下级节点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int[] GetSubOrgIds(int orgId)
|
private Guid[] GetSubOrgIds(Guid orgId)
|
||||||
{
|
{
|
||||||
if (orgId == 0)
|
if (orgId == Guid.Empty)
|
||||||
{
|
{
|
||||||
return _categoryRepository.Find(null).Select(u => u.Id).ToArray();
|
return _categoryRepository.Find(null).Select(u => u.Id).ToArray();
|
||||||
}
|
}
|
||||||
@@ -84,7 +86,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
return orgs;
|
return orgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Resource Find(int id)
|
public Resource Find(Guid id)
|
||||||
{
|
{
|
||||||
var resource = _repository.FindSingle(u => u.Id == id);
|
var resource = _repository.FindSingle(u => u.Id == id);
|
||||||
if (resource == null) return new Resource();
|
if (resource == null) return new Resource();
|
||||||
@@ -92,14 +94,14 @@ namespace OpenAuth.Domain.Service
|
|||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
_repository.Delete(id);
|
_repository.Delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddOrUpdate(Resource resource)
|
public void AddOrUpdate(Resource resource)
|
||||||
{
|
{
|
||||||
if (resource.Id == 0)
|
if (resource.Id == Guid.Empty)
|
||||||
{
|
{
|
||||||
_repository.Add(resource);
|
_repository.Add(resource);
|
||||||
}
|
}
|
||||||
@@ -119,7 +121,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
/// 当为UserResource时,表示UserId
|
/// 当为UserResource时,表示UserId
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="cId">分类ID</param>
|
/// <param name="cId">分类ID</param>
|
||||||
public List<dynamic> LoadWithAccess(string username, string accessType, int firstId, int cId)
|
public List<dynamic> LoadWithAccess(string username, string accessType, Guid firstId, Guid cId)
|
||||||
{
|
{
|
||||||
var listVms = new List<dynamic>();
|
var listVms = new List<dynamic>();
|
||||||
_authoriseService.LoadAuthControls(username);
|
_authoriseService.LoadAuthControls(username);
|
||||||
@@ -129,7 +131,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
}
|
}
|
||||||
|
|
||||||
var subIds = GetSubOrgIds(cId);
|
var subIds = GetSubOrgIds(cId);
|
||||||
var query = _authoriseService.Resources.Where(u => cId == 0 || subIds.Contains(u.CategoryId));
|
var query = _authoriseService.Resources.Where(u => cId == Guid.Empty || (u.CategoryId != null &&subIds.Contains(u.CategoryId.Value)));
|
||||||
|
|
||||||
foreach (var element in query)
|
foreach (var element in query)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据部门ID得到进出库信息
|
/// 根据部门ID得到进出库信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(string username, int orgId, int pageindex, int pagesize)
|
public dynamic Load(string username, Guid orgId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
|
|
||||||
_authoriseService.LoadAuthControls(username);
|
_authoriseService.LoadAuthControls(username);
|
||||||
@@ -47,8 +47,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
|
|
||||||
var keys = _authoriseService.Resources.Select(r => r.Key); //用户可访问的资源的KEY列表
|
var keys = _authoriseService.Resources.Select(r => r.Key); //用户可访问的资源的KEY列表
|
||||||
|
|
||||||
//由于库存Stock表开始没有设计资源有关的字段,暂时用User字段代替
|
Expression<Func<Stock, bool>> exp = u => u.OrgId != null &&orgs.Contains(u.OrgId.Value) && (u.Viewable == "" || keys.Contains(u.Viewable));
|
||||||
Expression<Func<Stock, bool>> exp = u => orgs.Contains(u.OrgId) && (u.User == "" || keys.Contains(u.User));
|
|
||||||
var stocks = _repository.Find(pageindex, pagesize, "", exp);
|
var stocks = _repository.Find(pageindex, pagesize, "", exp);
|
||||||
int total = _repository.GetCount(exp);
|
int total = _repository.GetCount(exp);
|
||||||
|
|
||||||
@@ -61,7 +60,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public Stock Find(int id)
|
public Stock Find(Guid id)
|
||||||
{
|
{
|
||||||
var stock = _repository.FindSingle(u => u.Id == id);
|
var stock = _repository.FindSingle(u => u.Id == id);
|
||||||
if (stock == null) return new Stock();
|
if (stock == null) return new Stock();
|
||||||
@@ -69,7 +68,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
return stock;
|
return stock;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Delete(int id)
|
public void Delete(Guid id)
|
||||||
{
|
{
|
||||||
_repository.Delete(id);
|
_repository.Delete(id);
|
||||||
}
|
}
|
||||||
@@ -77,7 +76,7 @@ namespace OpenAuth.Domain.Service
|
|||||||
public void AddOrUpdate(Stock stock)
|
public void AddOrUpdate(Stock stock)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (stock.Id == 0)
|
if (stock.Id == Guid.Empty)
|
||||||
{
|
{
|
||||||
_repository.Add(stock);
|
_repository.Add(stock);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,33 +7,26 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出入库信息表
|
/// 出入库信息表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Stock
|
public partial class Stock :Entity
|
||||||
{
|
{
|
||||||
public Stock()
|
public Stock()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.Name= string.Empty;
|
||||||
this.Name= string.Empty;
|
|
||||||
this.Number= 0;
|
this.Number= 0;
|
||||||
this.Price= 0;
|
this.Price= 0;
|
||||||
this.Status= 0;
|
this.Status= 0;
|
||||||
this.User= string.Empty;
|
this.Viewable = string.Empty;
|
||||||
this.Time= DateTime.Now;
|
this.Time= DateTime.Now;
|
||||||
this.OrgId= 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据ID
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 产品名称
|
/// 产品名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -53,7 +46,7 @@ namespace OpenAuth.Domain
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string User { get; set; }
|
public string Viewable { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作时间
|
/// 操作时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -61,7 +54,7 @@ namespace OpenAuth.Domain
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 组织ID
|
/// 组织ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int OrgId { get; set; }
|
public System.Guid? OrgId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,21 +7,19 @@
|
|||||||
// Author:Yubao Li
|
// Author:Yubao Li
|
||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
namespace OpenAuth.Domain
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class User
|
public partial class User :Entity
|
||||||
{
|
{
|
||||||
public User()
|
public User()
|
||||||
{
|
{
|
||||||
this.Id= 0;
|
this.Account= string.Empty;
|
||||||
this.Account= string.Empty;
|
|
||||||
this.Password= string.Empty;
|
this.Password= string.Empty;
|
||||||
this.Name= string.Empty;
|
this.Name= string.Empty;
|
||||||
this.Sex= 0;
|
this.Sex= 0;
|
||||||
@@ -29,13 +27,8 @@ namespace OpenAuth.Domain
|
|||||||
this.Type= 0;
|
this.Type= 0;
|
||||||
this.BizCode= string.Empty;
|
this.BizCode= string.Empty;
|
||||||
this.CreateTime= DateTime.Now;
|
this.CreateTime= DateTime.Now;
|
||||||
this.CreateId= 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -71,7 +64,6 @@ namespace OpenAuth.Domain
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CreateId { get; set; }
|
public System.Guid? CrateId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <autogenerated>
|
|
||||||
// This code was generated by a CodeSmith Template.
|
|
||||||
//
|
|
||||||
// DO NOT MODIFY contents of this file. Changes to this
|
|
||||||
// file will be lost if the code is regenerated.
|
|
||||||
// Author:Yubao Li
|
|
||||||
// </autogenerated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 用户配置表
|
|
||||||
/// </summary>
|
|
||||||
public partial class UserCfg
|
|
||||||
{
|
|
||||||
public UserCfg()
|
|
||||||
{
|
|
||||||
this.Id= 0;
|
|
||||||
this.Theme= string.Empty;
|
|
||||||
this.Skin= string.Empty;
|
|
||||||
this.NavBarStyle= string.Empty;
|
|
||||||
this.TabFocusColor= string.Empty;
|
|
||||||
this.NavTabIndex= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户ID
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 用户界面主题
|
|
||||||
/// </summary>
|
|
||||||
public string Theme { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 用户界面皮肤
|
|
||||||
/// </summary>
|
|
||||||
public string Skin { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 导航条按钮风格
|
|
||||||
/// </summary>
|
|
||||||
public string NavBarStyle { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Tab高亮颜色
|
|
||||||
/// </summary>
|
|
||||||
public string TabFocusColor { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 导航缺省活动页
|
|
||||||
/// </summary>
|
|
||||||
public int NavTabIndex { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <autogenerated>
|
|
||||||
// This code was generated by a CodeSmith Template.
|
|
||||||
//
|
|
||||||
// DO NOT MODIFY contents of this file. Changes to this
|
|
||||||
// file will be lost if the code is regenerated.
|
|
||||||
// Author:Yubao Li
|
|
||||||
// </autogenerated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 用户扩展信息表
|
|
||||||
/// </summary>
|
|
||||||
public partial class UserExt
|
|
||||||
{
|
|
||||||
public UserExt()
|
|
||||||
{
|
|
||||||
this.Id= 0;
|
|
||||||
this.Email= string.Empty;
|
|
||||||
this.Phone= string.Empty;
|
|
||||||
this.Mobile= string.Empty;
|
|
||||||
this.Address= string.Empty;
|
|
||||||
this.Zip= string.Empty;
|
|
||||||
this.Birthday= string.Empty;
|
|
||||||
this.IdCard= string.Empty;
|
|
||||||
this.Qq= string.Empty;
|
|
||||||
this.DynamicField= string.Empty;
|
|
||||||
this.ByteArrayId= 0;
|
|
||||||
this.Remark= string.Empty;
|
|
||||||
this.Field1= string.Empty;
|
|
||||||
this.Field2= string.Empty;
|
|
||||||
this.Field3= string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用户ID
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 电子邮件
|
|
||||||
/// </summary>
|
|
||||||
public string Email { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 固定电话
|
|
||||||
/// </summary>
|
|
||||||
public string Phone { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 移动电话
|
|
||||||
/// </summary>
|
|
||||||
public string Mobile { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 联系地址
|
|
||||||
/// </summary>
|
|
||||||
public string Address { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 邮编
|
|
||||||
/// </summary>
|
|
||||||
public string Zip { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 生日
|
|
||||||
/// </summary>
|
|
||||||
public string Birthday { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 身份证号
|
|
||||||
/// </summary>
|
|
||||||
public string IdCard { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// QQ
|
|
||||||
/// </summary>
|
|
||||||
public string Qq { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 动态扩展字段
|
|
||||||
/// </summary>
|
|
||||||
public string DynamicField { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 用户头像流文件ID
|
|
||||||
/// </summary>
|
|
||||||
public int ByteArrayId { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
public string Remark { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 静态扩展字段1
|
|
||||||
/// </summary>
|
|
||||||
public string Field1 { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 静态扩展字段2
|
|
||||||
/// </summary>
|
|
||||||
public string Field2 { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 静态扩展字段3
|
|
||||||
/// </summary>
|
|
||||||
public string Field3 { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -53,7 +53,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
//待选的树
|
//待选的树
|
||||||
var ztree = function () {
|
var ztree = function () {
|
||||||
var moduleIds;
|
var moduleIds = new Array();
|
||||||
var zTreeObj;
|
var zTreeObj;
|
||||||
var setting = {
|
var setting = {
|
||||||
view: {
|
view: {
|
||||||
@@ -84,10 +84,8 @@ var ztree = function () {
|
|||||||
|
|
||||||
function zTreeCheck(e, treeId, treeNode) {
|
function zTreeCheck(e, treeId, treeNode) {
|
||||||
var nodes = zTreeObj.getCheckedNodes(true);
|
var nodes = zTreeObj.getCheckedNodes(true);
|
||||||
if (nodes.length == 0) {
|
if (nodes.length != 0) {
|
||||||
moduleIds = null;
|
moduleIds = nodes.map(function(e) { return e.Id; });
|
||||||
} else {
|
|
||||||
moduleIds = '[' + nodes.map(function (e) { return e.Id; }).join(",") + ']';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function zTreeOnClick(event, treeId, treeNode) {
|
function zTreeOnClick(event, treeId, treeNode) {
|
||||||
@@ -110,7 +108,7 @@ var ztree = function () {
|
|||||||
|
|
||||||
//已分配的机构
|
//已分配的机构
|
||||||
var selected = function () {
|
var selected = function () {
|
||||||
var moduleIds;
|
var moduleIds = new Array();
|
||||||
var zTreeObj;
|
var zTreeObj;
|
||||||
var setting = {
|
var setting = {
|
||||||
view: {
|
view: {
|
||||||
@@ -141,10 +139,8 @@ var selected = function () {
|
|||||||
|
|
||||||
function zTreeCheck(e, treeId, treeNode) {
|
function zTreeCheck(e, treeId, treeNode) {
|
||||||
var nodes = zTreeObj.getCheckedNodes(true);
|
var nodes = zTreeObj.getCheckedNodes(true);
|
||||||
if (nodes.length == 0) {
|
if (nodes.length != 0) {
|
||||||
moduleIds = null;
|
moduleIds = nodes.map(function (e) { return e.Id; });
|
||||||
} else {
|
|
||||||
moduleIds = '[' + nodes.map(function (e) { return e.Id; }).join(",") + ']';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function zTreeOnClick(event, treeId, treeNode) {
|
function zTreeOnClick(event, treeId, treeNode) {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
//grid列表模块
|
//grid列表模块
|
||||||
function DialogList() {
|
function DialogList() {
|
||||||
var selectedId = 0; //选中的ID
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //选中的ID
|
||||||
var url = '/ModuleElementManager/LoadWithAccess?tId=';
|
var url = '/ModuleElementManager/LoadWithAccess?tId=';
|
||||||
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
|
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
//待选的树
|
//待选的树
|
||||||
var ztree = function () {
|
var ztree = function () {
|
||||||
var moduleIds;
|
var moduleIds = new Array();
|
||||||
var zTreeObj;
|
var zTreeObj;
|
||||||
var setting = {
|
var setting = {
|
||||||
view: {
|
view: {
|
||||||
@@ -84,10 +84,8 @@ var ztree = function () {
|
|||||||
|
|
||||||
function zTreeCheck(e, treeId, treeNode) {
|
function zTreeCheck(e, treeId, treeNode) {
|
||||||
var nodes = zTreeObj.getCheckedNodes(true);
|
var nodes = zTreeObj.getCheckedNodes(true);
|
||||||
if (nodes.length == 0) {
|
if (nodes.length != 0) {
|
||||||
moduleIds = null;
|
moduleIds = nodes.map(function (e) { return e.Id; });
|
||||||
} else {
|
|
||||||
moduleIds = '[' + nodes.map(function (e) { return e.Id; }).join(",") + ']';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function zTreeOnClick(event, treeId, treeNode) {
|
function zTreeOnClick(event, treeId, treeNode) {
|
||||||
@@ -110,7 +108,7 @@ var ztree = function () {
|
|||||||
|
|
||||||
//已分配的机构
|
//已分配的机构
|
||||||
var selected = function () {
|
var selected = function () {
|
||||||
var moduleIds;
|
var moduleIds = new Array();
|
||||||
var zTreeObj;
|
var zTreeObj;
|
||||||
var setting = {
|
var setting = {
|
||||||
view: {
|
view: {
|
||||||
@@ -141,10 +139,8 @@ var selected = function () {
|
|||||||
|
|
||||||
function zTreeCheck(e, treeId, treeNode) {
|
function zTreeCheck(e, treeId, treeNode) {
|
||||||
var nodes = zTreeObj.getCheckedNodes(true);
|
var nodes = zTreeObj.getCheckedNodes(true);
|
||||||
if (nodes.length == 0) {
|
if (nodes.length != 0) {
|
||||||
moduleIds = null;
|
moduleIds = nodes.map(function (e) { return e.Id; });
|
||||||
} else {
|
|
||||||
moduleIds = '[' + nodes.map(function (e) { return e.Id; }).join(",") + ']';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function zTreeOnClick(event, treeId, treeNode) {
|
function zTreeOnClick(event, treeId, treeNode) {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
//grid列表模块
|
//grid列表模块
|
||||||
function DialogList() {
|
function DialogList() {
|
||||||
var selectedId = 0; //选中的ID
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //选中的ID
|
||||||
var url = '/ResourceManager/LoadWithAccess?cId=';
|
var url = '/ResourceManager/LoadWithAccess?cId=';
|
||||||
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
|
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
//grid列表模块
|
//grid列表模块
|
||||||
function MainGrid() {
|
function MainGrid() {
|
||||||
var url = '/CategoryManager/Load?parentId=';
|
var url = '/CategoryManager/Load?parentId=';
|
||||||
var selectedId = 0; //ztree选中的模块
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
||||||
this.maingrid = $('#maingrid').datagrid({
|
this.maingrid = $('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
filterThead: false,
|
filterThead: false,
|
||||||
@@ -193,7 +193,7 @@ var editDlg = function () {
|
|||||||
update = false;
|
update = false;
|
||||||
show();
|
show();
|
||||||
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
||||||
$("#Id").val(0);
|
$("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
$("#SortNo").val(0);
|
$("#SortNo").val(0);
|
||||||
parentTree.show();
|
parentTree.show();
|
||||||
},
|
},
|
||||||
|
|||||||
190
OpenAuth.Mvc/BllScripts/goodsApply.js
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
//左边分类导航树
|
||||||
|
var ztree = function () {
|
||||||
|
var url = '/OrgManager/LoadOrg';
|
||||||
|
var setting = {
|
||||||
|
view: { selectedMulti: false },
|
||||||
|
data: {
|
||||||
|
key: {
|
||||||
|
name: 'Name',
|
||||||
|
title: 'Name'
|
||||||
|
},
|
||||||
|
simpleData: {
|
||||||
|
enable: true,
|
||||||
|
idKey: 'Id',
|
||||||
|
pIdKey: 'ParentId',
|
||||||
|
rootPId: 'null'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callback: {
|
||||||
|
onClick: function (event, treeId, treeNode) {
|
||||||
|
list.reload(treeNode.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var load = function () {
|
||||||
|
$.getJSON(url, function (json) {
|
||||||
|
var zTreeObj = $.fn.zTree.init($("#tree"), setting, json);
|
||||||
|
var firstId; //tree的第一个ID
|
||||||
|
if (json.length > 0) {
|
||||||
|
firstId = json[0].Id;
|
||||||
|
} else {
|
||||||
|
firstId = -1;
|
||||||
|
}
|
||||||
|
list.reload(firstId);
|
||||||
|
zTreeObj.expandAll(true);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
load();
|
||||||
|
|
||||||
|
return {
|
||||||
|
reload: load
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
//grid列表模块
|
||||||
|
function MainGrid() {
|
||||||
|
var url = '/GoodsApplies/Load?parentId=';
|
||||||
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
||||||
|
this.maingrid = $('#maingrid').datagrid({
|
||||||
|
showToolbar: false,
|
||||||
|
filterThead: false,
|
||||||
|
target: $(this),
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
name: 'Id',
|
||||||
|
label: '数据ID',
|
||||||
|
width: 100
|
||||||
|
, hide: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Name',
|
||||||
|
label: '产品名称',
|
||||||
|
width: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Number',
|
||||||
|
label: '产品数量',
|
||||||
|
width: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Price',
|
||||||
|
label: '产品单价',
|
||||||
|
width: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Status',
|
||||||
|
label: '出库/入库',
|
||||||
|
width: 100
|
||||||
|
, align: 'center',
|
||||||
|
items: [{ '0': '出库' }, { '1': '入库' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'User',
|
||||||
|
label: '可见范围(测试资源使用)',
|
||||||
|
width: 100,
|
||||||
|
items: [{ '': '全部可见' }, { 'ADMIN': '管理员可见' },{'DEV':'开发可见'}],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Time',
|
||||||
|
label: '操作时间',
|
||||||
|
width: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'OrgId',
|
||||||
|
label: '组织ID',
|
||||||
|
width: 100
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataUrl: url + selectedId,
|
||||||
|
fullGrid: true,
|
||||||
|
showLinenumber: true,
|
||||||
|
showCheckboxcol: true,
|
||||||
|
paging: true,
|
||||||
|
filterMult: false,
|
||||||
|
showTfoot: false,
|
||||||
|
|
||||||
|
});
|
||||||
|
this.reload = function (id) {
|
||||||
|
if (id != undefined) selectedId = id;
|
||||||
|
this.maingrid.datagrid('reload', { dataUrl: url + selectedId });
|
||||||
|
};
|
||||||
|
};
|
||||||
|
MainGrid.prototype = new Grid();
|
||||||
|
var list = new MainGrid();
|
||||||
|
|
||||||
|
|
||||||
|
//添加(编辑)对话框
|
||||||
|
var editDlg = function () {
|
||||||
|
var update = false;
|
||||||
|
var show = function () {
|
||||||
|
BJUI.dialog({ id: 'editDlg', title: '编辑对话框', target: '#editDlg' });
|
||||||
|
$("#btnSave").on("click", function () {
|
||||||
|
editDlg.save();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
add: function () { //弹出添加
|
||||||
|
update = false;
|
||||||
|
show();
|
||||||
|
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
||||||
|
$("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
|
},
|
||||||
|
update: function (ret) { //弹出编辑框
|
||||||
|
update = true;
|
||||||
|
show();
|
||||||
|
$('#Id').val(ret.Id);
|
||||||
|
$('#Name').val(ret.Name);
|
||||||
|
$('#Number').val(ret.Number);
|
||||||
|
},
|
||||||
|
save: function () { //编辑-->保存
|
||||||
|
$('#editForm').isValid(function (v) {
|
||||||
|
if (!v) return; //验证没通过
|
||||||
|
$("#editForm").bjuiajax('ajaxForm', {
|
||||||
|
reload: false,
|
||||||
|
callback: function (json) {
|
||||||
|
if (json.statusCode != "200") {
|
||||||
|
$(this).alertmsg('warn', json.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
list.reload();
|
||||||
|
ztree.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}();
|
||||||
|
|
||||||
|
//删除
|
||||||
|
function del() {
|
||||||
|
var selected = list.getSelectedObj();
|
||||||
|
if (selected == null) return;
|
||||||
|
|
||||||
|
$.getJSON('/GoodsApplies/Delete?Id=' + selected.Id, function (data) {
|
||||||
|
if (data.statusCode == "200") {
|
||||||
|
list.reload();
|
||||||
|
ztree.reload();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$(this).alertmsg('warn', data.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//自定义的编辑按钮
|
||||||
|
function edit() {
|
||||||
|
var selected = list.getSelectedObj();
|
||||||
|
if (selected == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
editDlg.update(selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
function add() {
|
||||||
|
editDlg.add();
|
||||||
|
}
|
||||||
|
|
||||||
|
function refresh() {
|
||||||
|
list.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//@@ sourceURL=StockManager.js
|
||||||
@@ -36,9 +36,9 @@ Grid.prototype.getSelectedMany = function () {
|
|||||||
//返回选择多行的属性JSON,默认选择id属性,如果选择其他属性,可重写
|
//返回选择多行的属性JSON,默认选择id属性,如果选择其他属性,可重写
|
||||||
Grid.prototype.getSelectedProperties = function (propName) {
|
Grid.prototype.getSelectedProperties = function (propName) {
|
||||||
var selected = this.selectObjs();
|
var selected = this.selectObjs();
|
||||||
if (selected == null) return null;
|
var result = new Array();
|
||||||
|
if (selected != null) {
|
||||||
var ids = selected.map(function (elem) { return elem[propName]; }).join(",");
|
result = selected.map(function (elem) { return elem[propName] ; });
|
||||||
ids = '[' + ids + ']'; //拼成一个JSON
|
}
|
||||||
return ids;
|
return result;
|
||||||
};
|
};
|
||||||
@@ -56,12 +56,16 @@ var thisDlg = function () {
|
|||||||
filterThead: false,
|
filterThead: false,
|
||||||
target: $(this),
|
target: $(this),
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
name: 'Id',
|
name: 'Id',
|
||||||
label: '流水号',
|
label: '流水号',
|
||||||
width: 100
|
hide: true
|
||||||
, hide: true
|
},
|
||||||
},
|
{
|
||||||
|
name: 'ModuleId',
|
||||||
|
label: '功能模块Id',
|
||||||
|
hide: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'DomId',
|
name: 'DomId',
|
||||||
label: 'DOM ID',
|
label: 'DOM ID',
|
||||||
@@ -77,11 +81,7 @@ var thisDlg = function () {
|
|||||||
label: '类型',
|
label: '类型',
|
||||||
width: 100
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'ModuleId',
|
|
||||||
label: '功能模块Id',
|
|
||||||
width: 100
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'Attr',
|
name: 'Attr',
|
||||||
label: '元素附加属性',
|
label: '元素附加属性',
|
||||||
@@ -162,10 +162,9 @@ var editEleDlg = function () {
|
|||||||
update = false;
|
update = false;
|
||||||
show();
|
show();
|
||||||
$("#editElementForm")[0].reset(); //reset方法只能通过dom调用
|
$("#editElementForm")[0].reset(); //reset方法只能通过dom调用
|
||||||
$.CurrentDialog.find("#Id").val(0);
|
$.CurrentDialog.find("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
$.CurrentDialog.find("#Sort").val('0');
|
$.CurrentDialog.find("#Sort").val('0');
|
||||||
$.CurrentDialog.find("#ModuleId").val(moduleId);
|
$.CurrentDialog.find("#ModuleId").val(moduleId);
|
||||||
|
|
||||||
},
|
},
|
||||||
update: function (ret) { //弹出编辑框
|
update: function (ret) { //弹出编辑框
|
||||||
update = true;
|
update = true;
|
||||||
@@ -175,7 +174,6 @@ var editEleDlg = function () {
|
|||||||
$.CurrentDialog.find('#Name').val(ret.Name);
|
$.CurrentDialog.find('#Name').val(ret.Name);
|
||||||
$.CurrentDialog.find('#Type').selectpicker('val', ret.Type);
|
$.CurrentDialog.find('#Type').selectpicker('val', ret.Type);
|
||||||
$.CurrentDialog.find('#ModuleId').val(ret.ModuleId);
|
$.CurrentDialog.find('#ModuleId').val(ret.ModuleId);
|
||||||
$.CurrentDialog.find('#Attr').val(ret.Attr);
|
|
||||||
$.CurrentDialog.find('#Script').val(ret.Script);
|
$.CurrentDialog.find('#Script').val(ret.Script);
|
||||||
$.CurrentDialog.find('#Icon').selectpicker('val', ret.Icon);
|
$.CurrentDialog.find('#Icon').selectpicker('val', ret.Icon);
|
||||||
$.CurrentDialog.find('#Class').selectpicker('val', ret.Class);
|
$.CurrentDialog.find('#Class').selectpicker('val', ret.Class);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
//grid列表模块
|
//grid列表模块
|
||||||
function MainGrid() {
|
function MainGrid() {
|
||||||
var url = '/ModuleManager/Load?orgId=';
|
var url = '/ModuleManager/Load?orgId=';
|
||||||
var selectedId = 0; //ztree选中的模块
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
||||||
this.maingrid = $('#maingrid').datagrid({
|
this.maingrid = $('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
filterThead: false,
|
filterThead: false,
|
||||||
@@ -215,7 +215,7 @@ var editDlg = function () {
|
|||||||
update = false;
|
update = false;
|
||||||
show();
|
show();
|
||||||
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
||||||
$("#Id").val(0);
|
$("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
|
|
||||||
parentTree.show()
|
parentTree.show()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ var ztree = function () {
|
|||||||
//grid列表模块
|
//grid列表模块
|
||||||
function MainGrid() {
|
function MainGrid() {
|
||||||
var url = '/OrgManager/LoadChildren?Id=';
|
var url = '/OrgManager/LoadChildren?Id=';
|
||||||
var selectedId = 0; //ztree选中的模块
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
||||||
this.maingrid = $('#maingrid').datagrid({
|
this.maingrid = $('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
filterThead: false,
|
filterThead: false,
|
||||||
@@ -196,7 +196,7 @@ var editDlg = function () {
|
|||||||
update = false;
|
update = false;
|
||||||
show();
|
show();
|
||||||
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
||||||
$("#Id").val(0);
|
$("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
|
|
||||||
parentTree.show()
|
parentTree.show()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//grid列表模块
|
//grid列表模块
|
||||||
function MainGrid() {
|
function MainGrid() {
|
||||||
var url = '/ResourceManager/Load?categoryId=';
|
var url = '/ResourceManager/Load?categoryId=';
|
||||||
var selectedId = 0; //ztree选中的模块
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
||||||
this.maingrid = $('#maingrid').datagrid({
|
this.maingrid = $('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
filterThead: false,
|
filterThead: false,
|
||||||
@@ -179,7 +179,7 @@ var editDlg = function () {
|
|||||||
update = false;
|
update = false;
|
||||||
show();
|
show();
|
||||||
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
||||||
$("#Id").val(0);
|
$("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
|
|
||||||
parentTree.show();
|
parentTree.show();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ var orgtree = function () {
|
|||||||
//grid列表模块
|
//grid列表模块
|
||||||
function MainGrid() {
|
function MainGrid() {
|
||||||
var url = '/RoleManager/Load?orgId=';
|
var url = '/RoleManager/Load?orgId=';
|
||||||
var selectedId = 0; //orgtree选中的模块
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //orgtree选中的模块
|
||||||
this.maingrid = $('#maingrid').datagrid({
|
this.maingrid = $('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
filterThead: false,
|
filterThead: false,
|
||||||
@@ -178,7 +178,7 @@ var editDlg = function () {
|
|||||||
update = false;
|
update = false;
|
||||||
show();
|
show();
|
||||||
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
||||||
$("#Id").val(0);
|
$("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
parentTree.show();
|
parentTree.show();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ var ztree = function () {
|
|||||||
//grid列表模块
|
//grid列表模块
|
||||||
function MainGrid() {
|
function MainGrid() {
|
||||||
var url = '/StockManager/Load?parentId=';
|
var url = '/StockManager/Load?parentId=';
|
||||||
var selectedId = 0; //ztree选中的模块
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
||||||
this.maingrid = $('#maingrid').datagrid({
|
this.maingrid = $('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
filterThead: false,
|
filterThead: false,
|
||||||
@@ -52,8 +52,12 @@ function MainGrid() {
|
|||||||
{
|
{
|
||||||
name: 'Id',
|
name: 'Id',
|
||||||
label: '数据ID',
|
label: '数据ID',
|
||||||
width: 100
|
hide: true
|
||||||
, hide: true
|
},
|
||||||
|
{
|
||||||
|
name: 'OrgId',
|
||||||
|
label: '组织ID',
|
||||||
|
hide:true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
@@ -78,7 +82,7 @@ function MainGrid() {
|
|||||||
items: [{ '0': '出库' }, { '1': '入库' }],
|
items: [{ '0': '出库' }, { '1': '入库' }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'User',
|
name: 'Viewable',
|
||||||
label: '可见范围(测试资源使用)',
|
label: '可见范围(测试资源使用)',
|
||||||
width: 100,
|
width: 100,
|
||||||
items: [{ '': '全部可见' }, { 'ADMIN': '管理员可见' },{'DEV':'开发可见'}],
|
items: [{ '': '全部可见' }, { 'ADMIN': '管理员可见' },{'DEV':'开发可见'}],
|
||||||
@@ -87,12 +91,7 @@ function MainGrid() {
|
|||||||
name: 'Time',
|
name: 'Time',
|
||||||
label: '操作时间',
|
label: '操作时间',
|
||||||
width: 100
|
width: 100
|
||||||
},
|
}
|
||||||
{
|
|
||||||
name: 'OrgId',
|
|
||||||
label: '组织ID',
|
|
||||||
width: 100
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
dataUrl: url + selectedId,
|
dataUrl: url + selectedId,
|
||||||
fullGrid: true,
|
fullGrid: true,
|
||||||
@@ -192,7 +191,7 @@ var editDlg = function () {
|
|||||||
update = false;
|
update = false;
|
||||||
show();
|
show();
|
||||||
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
||||||
$("#Id").val(0);
|
$("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
parentTree.show();
|
parentTree.show();
|
||||||
},
|
},
|
||||||
update: function (ret) { //弹出编辑框
|
update: function (ret) { //弹出编辑框
|
||||||
@@ -203,7 +202,7 @@ var editDlg = function () {
|
|||||||
$('#Number').val(ret.Number);
|
$('#Number').val(ret.Number);
|
||||||
$('#Price').val(ret.Price);
|
$('#Price').val(ret.Price);
|
||||||
$('#Status').selectpicker('val', ret.Status);
|
$('#Status').selectpicker('val', ret.Status);
|
||||||
$('#User').selectpicker('val', ret.User);
|
$('#Viewable').selectpicker('val', ret.Viewable);
|
||||||
$('#Time').val(ret.Time);
|
$('#Time').val(ret.Time);
|
||||||
$('#OrgId').val(ret.OrgId);
|
$('#OrgId').val(ret.OrgId);
|
||||||
parentTree.show();
|
parentTree.show();
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
//grid列表模块
|
//grid列表模块
|
||||||
function UserRolesList() {
|
function UserRolesList() {
|
||||||
var selectedId = 0; //选中的ID
|
var selectedId = '00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
||||||
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
|
this.maingrid = $.CurrentDialog.find('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
filterThead: false,
|
filterThead: false,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ var maintree = function () {
|
|||||||
//grid列表模块
|
//grid列表模块
|
||||||
function MainGrid() {
|
function MainGrid() {
|
||||||
var url = '/UserManager/Load?orgId=';
|
var url = '/UserManager/Load?orgId=';
|
||||||
var selectedId = 0; //ztree选中的模块
|
var selectedId ='00000000-0000-0000-0000-000000000000'; //ztree选中的模块
|
||||||
this.maingrid = $('#maingrid').datagrid({
|
this.maingrid = $('#maingrid').datagrid({
|
||||||
showToolbar: false,
|
showToolbar: false,
|
||||||
filterThead: false,
|
filterThead: false,
|
||||||
@@ -188,7 +188,7 @@ var editDlg = function () {
|
|||||||
update = false;
|
update = false;
|
||||||
show();
|
show();
|
||||||
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
$.CurrentDialog.find("form")[0].reset(); //reset方法只能通过dom调用
|
||||||
$("#Id").val(0);
|
$("#Id").val('00000000-0000-0000-0000-000000000000');
|
||||||
parentTree.show();
|
parentTree.show();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载分类下面的所有分类
|
/// 加载分类下面的所有分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Load(int parentId, int pageCurrent = 1, int pageSize = 30)
|
public string Load(Guid parentId, int pageCurrent = 1, int pageSize = 30)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.Load(parentId, pageCurrent, pageSize));
|
return JsonHelper.Instance.Serialize(_app.Load(parentId, pageCurrent, pageSize));
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Delete(int Id)
|
public string Delete(Guid Id)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using OptimaJet.Workflow;
|
using System;
|
||||||
using OptimaJet.Workflow.Core.Builder;
|
|
||||||
using OptimaJet.Workflow.Core.Bus;
|
|
||||||
using OptimaJet.Workflow.Core.Runtime;
|
|
||||||
using OptimaJet.Workflow.Core.Parser;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -12,9 +6,14 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
using OptimaJet.Workflow;
|
||||||
|
using OptimaJet.Workflow.Core.Builder;
|
||||||
|
using OptimaJet.Workflow.Core.Bus;
|
||||||
|
using OptimaJet.Workflow.Core.Runtime;
|
||||||
|
using OptimaJet.Workflow.DbPersistence;
|
||||||
using WorkflowRuntime = OptimaJet.Workflow.Core.Runtime.WorkflowRuntime;
|
using WorkflowRuntime = OptimaJet.Workflow.Core.Runtime.WorkflowRuntime;
|
||||||
|
|
||||||
namespace WF.Sample.Controllers
|
namespace OpenAuth.Mvc.Controllers
|
||||||
{
|
{
|
||||||
public class DesignerController : Controller
|
public class DesignerController : Controller
|
||||||
{
|
{
|
||||||
@@ -44,47 +43,13 @@ namespace WF.Sample.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var res = getRuntime.DesignerAPI(pars, filestream, true);
|
var res = WorkflowInit.Runtime.DesignerAPI(pars, filestream, true);
|
||||||
if (pars["operation"].ToLower() == "downloadscheme")
|
if (pars["operation"].ToLower() == "downloadscheme")
|
||||||
return File(Encoding.UTF8.GetBytes(res), "text/xml", "scheme.xml");
|
return File(Encoding.UTF8.GetBytes(res), "text/xml", "scheme.xml");
|
||||||
return Content(res);
|
return Content(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static volatile WorkflowRuntime _runtime;
|
}
|
||||||
private static readonly object _sync = new object();
|
|
||||||
|
|
||||||
private WorkflowRuntime getRuntime
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_runtime == null)
|
|
||||||
{
|
|
||||||
lock (_sync)
|
|
||||||
{
|
|
||||||
if (_runtime == null)
|
|
||||||
{
|
|
||||||
var connectionString = ConfigurationManager.ConnectionStrings["WorkFlow"].ConnectionString;
|
|
||||||
var builder = new WorkflowBuilder<XElement>(
|
|
||||||
new OptimaJet.Workflow.DbPersistence.DbXmlWorkflowGenerator(connectionString),
|
|
||||||
new OptimaJet.Workflow.Core.Parser.XmlWorkflowParser(),
|
|
||||||
new OptimaJet.Workflow.DbPersistence.DbSchemePersistenceProvider(connectionString)
|
|
||||||
).WithDefaultCache();
|
|
||||||
|
|
||||||
_runtime = new WorkflowRuntime(new Guid("{8D38DB8F-F3D5-4F26-A989-4FDD40F32D9D}"))
|
|
||||||
.WithBuilder(builder)
|
|
||||||
.WithPersistenceProvider(new OptimaJet.Workflow.DbPersistence.DbPersistenceProvider(connectionString))
|
|
||||||
.WithTimerManager(new TimerManager())
|
|
||||||
.WithBus(new NullBus())
|
|
||||||
.SwitchAutoUpdateSchemeBeforeGetAvailableCommandsOn()
|
|
||||||
.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return _runtime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
75
OpenAuth.Mvc/Controllers/GoodsAppliesController.cs
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
using Infrastructure;
|
||||||
|
using OpenAuth.App;
|
||||||
|
using OpenAuth.App.SSO;
|
||||||
|
using OpenAuth.Domain;
|
||||||
|
using OptimaJet.Workflow.Core.Runtime;
|
||||||
|
using ProcessStatus = OptimaJet.Workflow.Core.Persistence.ProcessStatus;
|
||||||
|
|
||||||
|
namespace OpenAuth.Mvc.Controllers
|
||||||
|
{
|
||||||
|
public class GoodsAppliesController : BaseController
|
||||||
|
{
|
||||||
|
private GoodsApplyApp _app;
|
||||||
|
|
||||||
|
public GoodsAppliesController()
|
||||||
|
{
|
||||||
|
_app = AutofacExt.GetFromFac<GoodsApplyApp>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Index()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Load(Guid parentId, int pageCurrent = 1, int pageSize = 30)
|
||||||
|
{
|
||||||
|
return JsonHelper.Instance.Serialize(_app.Load(AuthUtil.GetCurrentUser().User.Id, parentId, pageCurrent, pageSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public string Edit(GoodsApply apply)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
apply.UserId = AuthUtil.GetCurrentUser().User.Id;
|
||||||
|
_app.AddOrUpdate(apply);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
BjuiResponse.statusCode = "300";
|
||||||
|
BjuiResponse.message = ex.Message;
|
||||||
|
}
|
||||||
|
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
public dynamic Get(Guid id)
|
||||||
|
{
|
||||||
|
var apply = _app.Get(id);
|
||||||
|
CreateWorkflowIfNotExists(id);
|
||||||
|
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
Apply=apply
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void CreateWorkflowIfNotExists(Guid id)
|
||||||
|
{
|
||||||
|
if (WorkflowInit.Runtime.IsProcessExists(id))
|
||||||
|
return;
|
||||||
|
|
||||||
|
using (var sync = new WorkflowSync(WorkflowInit.Runtime, id))
|
||||||
|
{
|
||||||
|
WorkflowInit.Runtime.CreateInstance("SimpleWF", id);
|
||||||
|
|
||||||
|
sync.StatrtWaitingFor(new List<ProcessStatus> { ProcessStatus.Initialized, ProcessStatus.Initialized });
|
||||||
|
|
||||||
|
sync.Wait(new TimeSpan(0, 0, 10));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,12 +31,12 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
{
|
{
|
||||||
_app = AutofacExt.GetFromFac<ModuleElementManagerApp>();
|
_app = AutofacExt.GetFromFac<ModuleElementManagerApp>();
|
||||||
}
|
}
|
||||||
public ActionResult Index(int id)
|
public ActionResult Index(Guid id)
|
||||||
{
|
{
|
||||||
ViewBag.ModuleId = id;
|
ViewBag.ModuleId = id;
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
public ActionResult Get(int moduleId = 0)
|
public ActionResult Get(Guid moduleId)
|
||||||
{
|
{
|
||||||
return Json(_app.LoadByModuleId(moduleId));
|
return Json(_app.LoadByModuleId(moduleId));
|
||||||
}
|
}
|
||||||
@@ -76,13 +76,13 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <param name="firstId">The first identifier.</param>
|
/// <param name="firstId">The first identifier.</param>
|
||||||
/// <param name="key">The key.</param>
|
/// <param name="key">The key.</param>
|
||||||
/// <returns>ActionResult.</returns>
|
/// <returns>ActionResult.</returns>
|
||||||
public ActionResult AssignModuleElement(int firstId, string key)
|
public ActionResult AssignModuleElement(Guid firstId, string key)
|
||||||
{
|
{
|
||||||
ViewBag.FirstId = firstId;
|
ViewBag.FirstId = firstId;
|
||||||
ViewBag.ModuleType = key;
|
ViewBag.ModuleType = key;
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
public string LoadWithAccess(int tId, int firstId, string key)
|
public string LoadWithAccess(Guid tId, Guid firstId, string key)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.LoadWithAccess(key, firstId, tId));
|
return JsonHelper.Instance.Serialize(_app.LoadWithAccess(key, firstId, tId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
using OpenAuth.App;
|
using OpenAuth.App;
|
||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using OpenAuth.App.SSO;
|
using OpenAuth.App.SSO;
|
||||||
using OpenAuth.App.ViewModel;
|
using OpenAuth.App.ViewModel;
|
||||||
@@ -26,7 +25,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Assign(int firstId, string key)
|
public ActionResult Assign(Guid firstId, string key)
|
||||||
{
|
{
|
||||||
ViewBag.FirstId = firstId;
|
ViewBag.FirstId = firstId;
|
||||||
ViewBag.ModuleType = key;
|
ViewBag.ModuleType = key;
|
||||||
@@ -36,7 +35,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载模块下面的所有模块
|
/// 加载模块下面的所有模块
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Load(int orgId, int pageCurrent = 1, int pageSize = 30)
|
public string Load(Guid orgId, int pageCurrent = 1, int pageSize = 30)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
||||||
}
|
}
|
||||||
@@ -61,7 +60,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="firstId">The user identifier.</param>
|
/// <param name="firstId">The user identifier.</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
public string LoadForUser(int firstId)
|
public string LoadForUser(Guid firstId)
|
||||||
{
|
{
|
||||||
var orgs = _app.LoadForUser(firstId);
|
var orgs = _app.LoadForUser(firstId);
|
||||||
return JsonHelper.Instance.Serialize(orgs);
|
return JsonHelper.Instance.Serialize(orgs);
|
||||||
@@ -72,7 +71,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="firstId">The role identifier.</param>
|
/// <param name="firstId">The role identifier.</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
public string LoadForRole(int firstId)
|
public string LoadForRole(Guid firstId)
|
||||||
{
|
{
|
||||||
var orgs = _app.LoadForRole(firstId);
|
var orgs = _app.LoadForRole(firstId);
|
||||||
return JsonHelper.Instance.Serialize(orgs);
|
return JsonHelper.Instance.Serialize(orgs);
|
||||||
@@ -102,7 +101,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
{
|
{
|
||||||
foreach (var obj in Id.Split(','))
|
foreach (var obj in Id.Split(','))
|
||||||
{
|
{
|
||||||
_app.Delete(int.Parse(obj));
|
_app.Delete(Guid.Parse(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
@@ -3,11 +3,8 @@ using OpenAuth.App;
|
|||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
using OpenAuth.Mvc.Models;
|
using OpenAuth.Mvc.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using OpenAuth.App.SSO;
|
using OpenAuth.App.SSO;
|
||||||
using OpenAuth.App.ViewModel;
|
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Controllers
|
namespace OpenAuth.Mvc.Controllers
|
||||||
{
|
{
|
||||||
@@ -27,7 +24,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
{
|
{
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
public ActionResult Assign(int firstId, string key)
|
public ActionResult Assign(Guid firstId, string key)
|
||||||
{
|
{
|
||||||
ViewBag.FirstId = firstId;
|
ViewBag.FirstId = firstId;
|
||||||
ViewBag.ModuleType = key;
|
ViewBag.ModuleType = key;
|
||||||
@@ -39,13 +36,13 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return JsonHelper.Instance.Serialize(AuthUtil.GetCurrentUser().AccessedOrgs);
|
return JsonHelper.Instance.Serialize(AuthUtil.GetCurrentUser().AccessedOrgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string LoadForUser(int firstId)
|
public string LoadForUser(Guid firstId)
|
||||||
{
|
{
|
||||||
var orgs = _orgApp.LoadForUser(firstId);
|
var orgs = _orgApp.LoadForUser(firstId);
|
||||||
return JsonHelper.Instance.Serialize(orgs);
|
return JsonHelper.Instance.Serialize(orgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string LoadForRole(int firstId)
|
public string LoadForRole(Guid firstId)
|
||||||
{
|
{
|
||||||
var orgs = _orgApp.LoadForRole(firstId);
|
var orgs = _orgApp.LoadForRole(firstId);
|
||||||
return JsonHelper.Instance.Serialize(orgs);
|
return JsonHelper.Instance.Serialize(orgs);
|
||||||
@@ -68,7 +65,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string LoadChildren(int id)
|
public string LoadChildren(Guid id)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_orgApp.LoadAllChildren(id));
|
return JsonHelper.Instance.Serialize(_orgApp.LoadAllChildren(id));
|
||||||
}
|
}
|
||||||
@@ -78,7 +75,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <para>Id为逗号分开的字符串</para>
|
/// <para>Id为逗号分开的字符串</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
public string DelOrg(int Id)
|
public string DelOrg(Guid Id)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,12 +20,11 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public string Assign(string type, int firstId, string secIds)
|
public string Assign(string type, Guid firstId, Guid[] secIds)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var secIdList = JsonHelper.Instance.Deserialize<int[]>(secIds);
|
_app.Assign(type, firstId, secIds);
|
||||||
_app.Assign(type, firstId, secIdList);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -35,12 +34,11 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||||
}
|
}
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public string UnAssign(string type, int firstId, string secIds)
|
public string UnAssign(string type, Guid firstId, Guid[] secIds)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var secIdList = JsonHelper.Instance.Deserialize<int[]>(secIds);
|
_app.UnAssign(type, firstId, secIds);
|
||||||
_app.UnAssign(type, firstId, secIdList);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载某分类的所有Resources
|
/// 加载某分类的所有Resources
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Load(int categoryId, int pageCurrent = 1, int pageSize = 30)
|
public string Load(Guid categoryId, int pageCurrent = 1, int pageSize = 30)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.Load(AuthUtil.GetUserName(), categoryId, pageCurrent, pageSize));
|
return JsonHelper.Instance.Serialize(_app.Load(AuthUtil.GetUserName(), categoryId, pageCurrent, pageSize));
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return JsonHelper.Instance.Serialize(models);
|
return JsonHelper.Instance.Serialize(models);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Delete(int Id)
|
public string Delete(Guid Id)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -79,7 +79,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <para>如:UserResource/RoleResource</para>
|
/// <para>如:UserResource/RoleResource</para>
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <returns>ActionResult.</returns>
|
/// <returns>ActionResult.</returns>
|
||||||
public ActionResult AssignRes(int firstId, string key)
|
public ActionResult AssignRes(Guid firstId, string key)
|
||||||
{
|
{
|
||||||
ViewBag.FirstId = firstId;
|
ViewBag.FirstId = firstId;
|
||||||
ViewBag.ModuleType = key;
|
ViewBag.ModuleType = key;
|
||||||
@@ -93,7 +93,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <param name="firstId">关联表中的firstId</param>
|
/// <param name="firstId">关联表中的firstId</param>
|
||||||
/// <param name="key">关联表中的key</param>
|
/// <param name="key">关联表中的key</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
public string LoadWithAccess(int cId, int firstId, string key)
|
public string LoadWithAccess(Guid cId, Guid firstId, string key)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.LoadWithAccess(AuthUtil.GetUserName(),key,firstId, cId));
|
return JsonHelper.Instance.Serialize(_app.LoadWithAccess(AuthUtil.GetUserName(),key,firstId, cId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载角色下面的所有用户
|
/// 加载角色下面的所有用户
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Load(int orgId, int pageCurrent = 1, int pageSize = 30)
|
public string Load(Guid orgId, int pageCurrent = 1, int pageSize = 30)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
{
|
{
|
||||||
foreach (var obj in Id.Split(','))
|
foreach (var obj in Id.Split(','))
|
||||||
{
|
{
|
||||||
_app.Delete(int.Parse(obj));
|
_app.Delete(Guid.Parse(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -68,28 +68,26 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region 为用户设置角色界面
|
#region 为用户设置角色界面
|
||||||
public ActionResult LookupMulti(int userId)
|
public ActionResult LookupMulti(Guid userId)
|
||||||
{
|
{
|
||||||
ViewBag.UserId = userId;
|
ViewBag.UserId = userId;
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string LoadForOrgAndUser(int orgId, int userId)
|
public string LoadForOrgAndUser(Guid orgId, Guid userId)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.LoadForOrgAndUser(orgId, userId));
|
return JsonHelper.Instance.Serialize(_app.LoadForOrgAndUser(orgId, userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public string AccessRoles(int userId, string ids)
|
public string AccessRoles(Guid userId, Guid[] ids)
|
||||||
{
|
{
|
||||||
var roleids = JsonHelper.Instance.Deserialize<int[]>(ids);
|
_app.AccessRole(userId, ids);
|
||||||
_app.AccessRole(userId, roleids);
|
|
||||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string DelAccessRoles(int userId, string ids)
|
public string DelAccessRoles(Guid userId, Guid[] ids)
|
||||||
{
|
{
|
||||||
var roleids = JsonHelper.Instance.Deserialize<int[]>(ids);
|
_app.DelAccessRole(userId, ids);
|
||||||
_app.DelAccessRole(userId, roleids);
|
|
||||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,12 +50,12 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载节点下面的所有Stocks
|
/// 加载节点下面的所有Stocks
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Load(int parentId, int pageCurrent = 1, int pageSize = 30)
|
public string Load(Guid parentId, int pageCurrent = 1, int pageSize = 30)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.Load(AuthUtil.GetUserName(), parentId, pageCurrent, pageSize));
|
return JsonHelper.Instance.Serialize(_app.Load(AuthUtil.GetUserName(), parentId, pageCurrent, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Delete(int Id)
|
public string Delete(Guid Id)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载组织下面的所有用户
|
/// 加载组织下面的所有用户
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Load(int orgId, int pageCurrent = 1, int pageSize = 30)
|
public string Load(Guid orgId, int pageCurrent = 1, int pageSize = 30)
|
||||||
{
|
{
|
||||||
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Delete(int Id)
|
public string Delete(Guid Id)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
134
OpenAuth.Mvc/Controllers/WorkFlowDesignerController.cs
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
|
||||||
|
namespace OpenAuth.Mvc.Controllers
|
||||||
|
{
|
||||||
|
public class WorkFlowDesignerController : Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// GET: /WorkFlowDesigner/
|
||||||
|
|
||||||
|
public ActionResult Index()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Open()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Open_Tree()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string GetJSON()
|
||||||
|
{
|
||||||
|
//string flowid = Request.QueryString["flowid"];
|
||||||
|
//string type = Request.QueryString["type"];
|
||||||
|
//if (!flowid.IsGuid())
|
||||||
|
//{
|
||||||
|
// return "{}";
|
||||||
|
//}
|
||||||
|
//var flow = new Business.Platform.WorkFlow().Get(flowid.ToGuid());
|
||||||
|
//if (flow == null)
|
||||||
|
//{
|
||||||
|
return "{}";
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// return "0" == type ? flow.RunJSON : flow.DesignJSON;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Set_Flow()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTables()
|
||||||
|
{
|
||||||
|
Response.Charset = "utf-8";
|
||||||
|
//string connID = Request.QueryString["connid"];
|
||||||
|
//if (!connID.IsGuid())
|
||||||
|
//{
|
||||||
|
return "[]";
|
||||||
|
//}
|
||||||
|
//List<string> tables = new Business.Platform.DBConnection().GetTables(connID.ToGuid());
|
||||||
|
//System.Text.StringBuilder sb = new System.Text.StringBuilder("[", 1000);
|
||||||
|
//foreach (string table in tables)
|
||||||
|
//{
|
||||||
|
// sb.Append("{\"name\":");
|
||||||
|
// sb.AppendFormat("\"{0}\"", table);
|
||||||
|
// sb.Append("},");
|
||||||
|
//}
|
||||||
|
//return sb.ToString().TrimEnd(',') + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetFields()
|
||||||
|
{
|
||||||
|
string table = Request.QueryString["table"];
|
||||||
|
string connid = Request.QueryString["connid"];
|
||||||
|
|
||||||
|
//if (table.IsNullOrEmpty() || !connid.IsGuid())
|
||||||
|
//{
|
||||||
|
return "[]";
|
||||||
|
//}
|
||||||
|
//Dictionary<string, string> fields = new Business.Platform.DBConnection().GetFields(connid.ToGuid(), table);
|
||||||
|
//System.Text.StringBuilder sb = new System.Text.StringBuilder("[", 1000);
|
||||||
|
|
||||||
|
//foreach (var field in fields)
|
||||||
|
//{
|
||||||
|
// sb.Append("{");
|
||||||
|
// sb.AppendFormat("\"name\":\"{0}\",\"note\":\"{1}\"", field.Key, field.Value);
|
||||||
|
// sb.Append("},");
|
||||||
|
//}
|
||||||
|
//return sb.ToString().TrimEnd(',') + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ActionResult Set_Step()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Set_SubFlow()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Set_Line()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Opation()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Save()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult Install()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult UnInstall()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActionResult SaveAs()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
34
OpenAuth.Mvc/Controllers/WorkflowActionProvider.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using OpenAuth.App;
|
||||||
|
using OptimaJet.Workflow.Core.Model;
|
||||||
|
using OptimaJet.Workflow.Core.Runtime;
|
||||||
|
|
||||||
|
namespace OpenAuth.Mvc.Controllers
|
||||||
|
{
|
||||||
|
public class WorkflowActionProvider :IWorkflowActionProvider
|
||||||
|
{
|
||||||
|
private ModuleManagerApp _app;
|
||||||
|
|
||||||
|
public WorkflowActionProvider()
|
||||||
|
{
|
||||||
|
_app = AutofacExt.GetFromFac<ModuleManagerApp>();
|
||||||
|
}
|
||||||
|
public void ExecuteAction(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ExecuteCondition(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<string> GetActions()
|
||||||
|
{
|
||||||
|
return new List<string>{"ok"};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
50
OpenAuth.Mvc/Controllers/WorkflowInit.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using System;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using OptimaJet.Workflow.Core.Builder;
|
||||||
|
using OptimaJet.Workflow.Core.Bus;
|
||||||
|
using OptimaJet.Workflow.Core.Runtime;
|
||||||
|
using OptimaJet.Workflow.DbPersistence;
|
||||||
|
|
||||||
|
namespace OpenAuth.Mvc.Controllers
|
||||||
|
{
|
||||||
|
public class WorkflowInit
|
||||||
|
{
|
||||||
|
private static volatile WorkflowRuntime _runtime;
|
||||||
|
private static readonly object _sync = new object();
|
||||||
|
|
||||||
|
public static WorkflowRuntime Runtime
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_runtime == null)
|
||||||
|
{
|
||||||
|
lock (_sync)
|
||||||
|
{
|
||||||
|
if (_runtime == null)
|
||||||
|
{
|
||||||
|
var connectionString = ConfigurationManager.ConnectionStrings["WorkFlow"].ConnectionString;
|
||||||
|
var builder = new WorkflowBuilder<XElement>(
|
||||||
|
new MSSQLProvider(connectionString),
|
||||||
|
new OptimaJet.Workflow.Core.Parser.XmlWorkflowParser(),
|
||||||
|
new MSSQLProvider(connectionString)
|
||||||
|
).WithDefaultCache();
|
||||||
|
|
||||||
|
_runtime = new WorkflowRuntime(new Guid("{8D38DB8F-F3D5-4F26-A989-4FDD40F32D9D}"))
|
||||||
|
.WithBuilder(builder)
|
||||||
|
// .WithRuleProvider(new WorkflowRuleProvider())
|
||||||
|
// .WithActionProvider(new WorkflowActionProvider())
|
||||||
|
.WithPersistenceProvider(new MSSQLProvider(connectionString))
|
||||||
|
.WithTimerManager(new TimerManager())
|
||||||
|
.WithBus(new NullBus())
|
||||||
|
.SwitchAutoUpdateSchemeBeforeGetAvailableCommandsOn()
|
||||||
|
.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _runtime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
40
OpenAuth.Mvc/Controllers/WorkflowRuleProvider.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using OpenAuth.App;
|
||||||
|
using OptimaJet.Workflow.Core.Model;
|
||||||
|
using OptimaJet.Workflow.Core.Runtime;
|
||||||
|
|
||||||
|
namespace OpenAuth.Mvc.Controllers
|
||||||
|
{
|
||||||
|
public class WorkflowRuleProvider : IWorkflowRuleProvider
|
||||||
|
{
|
||||||
|
private RoleManagerApp _app;
|
||||||
|
|
||||||
|
public WorkflowRuleProvider()
|
||||||
|
{
|
||||||
|
_app = AutofacExt.GetFromFac<RoleManagerApp>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<string> GetRules()
|
||||||
|
{
|
||||||
|
var roles = _app.Load(Guid.Empty, 1, 100).list;
|
||||||
|
var rolestrs = new List<string>();
|
||||||
|
foreach (var role in roles)
|
||||||
|
{
|
||||||
|
rolestrs.Add(role.Name);
|
||||||
|
}
|
||||||
|
return rolestrs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Check(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName,
|
||||||
|
string parameter)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<string> GetIdentities(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
OpenAuth.Mvc/Images/ico/2012080111634.png
Normal file
|
After Width: | Height: | Size: 356 B |
BIN
OpenAuth.Mvc/Images/ico/2012080404391.png
Normal file
|
After Width: | Height: | Size: 686 B |
BIN
OpenAuth.Mvc/Images/ico/2012092109942.png
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
OpenAuth.Mvc/Images/ico/20130406011043129_easyicon_net_16.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
OpenAuth.Mvc/Images/ico/20130406014311476_easyicon_net_16.png
Normal file
|
After Width: | Height: | Size: 917 B |
BIN
OpenAuth.Mvc/Images/ico/Properties.png
Normal file
|
After Width: | Height: | Size: 592 B |
BIN
OpenAuth.Mvc/Images/ico/Refresh.png
Normal file
|
After Width: | Height: | Size: 502 B |
BIN
OpenAuth.Mvc/Images/ico/accept.gif
Normal file
|
After Width: | Height: | Size: 347 B |
BIN
OpenAuth.Mvc/Images/ico/add.gif
Normal file
|
After Width: | Height: | Size: 341 B |
BIN
OpenAuth.Mvc/Images/ico/against.gif
Normal file
|
After Width: | Height: | Size: 581 B |
BIN
OpenAuth.Mvc/Images/ico/agree.gif
Normal file
|
After Width: | Height: | Size: 594 B |
BIN
OpenAuth.Mvc/Images/ico/application_osx_add.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
OpenAuth.Mvc/Images/ico/application_osx_double.png
Normal file
|
After Width: | Height: | Size: 573 B |
BIN
OpenAuth.Mvc/Images/ico/application_osx_remove.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
OpenAuth.Mvc/Images/ico/application_windows_down.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
OpenAuth.Mvc/Images/ico/arrow_large_down.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
OpenAuth.Mvc/Images/ico/arrow_large_left.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
OpenAuth.Mvc/Images/ico/arrow_large_right.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
OpenAuth.Mvc/Images/ico/arrow_medium_down.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
OpenAuth.Mvc/Images/ico/arrow_medium_left.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
OpenAuth.Mvc/Images/ico/arrow_medium_lower_left.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |