mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-04-07 17:41:28 +08:00
调整结构
This commit is contained in:
@@ -20,9 +20,9 @@ namespace OpenAuth.App
|
||||
_unitWork = unitWork;
|
||||
}
|
||||
|
||||
public int GetCategoryCntInOrg(Guid orgId)
|
||||
public int GetCategoryCntInOrg(string orgId)
|
||||
{
|
||||
if (orgId == Guid.Empty)
|
||||
if (orgId == string.Empty)
|
||||
{
|
||||
return _repository.Find(null).Count();
|
||||
}
|
||||
@@ -40,11 +40,11 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个分类及子分类全部Categorys
|
||||
/// </summary>
|
||||
public GridData Load(Guid parentId, int pageindex, int pagesize)
|
||||
public GridData Load(string parentId, int pageindex, int pagesize)
|
||||
{
|
||||
IQueryable<Category> categories;
|
||||
int total = 0;
|
||||
if (parentId == Guid.Empty)
|
||||
if (parentId == string.Empty)
|
||||
{
|
||||
categories = _unitWork.Find<Category>(pageindex, pagesize);
|
||||
total = _repository.GetCount();
|
||||
@@ -66,8 +66,6 @@ namespace OpenAuth.App
|
||||
c.ParentId,
|
||||
ParentName = category.Name,
|
||||
c.SortNo,
|
||||
c.RootName,
|
||||
c.RootKey,
|
||||
c.Status,
|
||||
c.Id
|
||||
};
|
||||
@@ -83,14 +81,14 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 获取当前组织的所有下级组织
|
||||
/// </summary>
|
||||
private Guid[] GetSubCategories(Guid orgId)
|
||||
private string[] GetSubCategories(string orgId)
|
||||
{
|
||||
var category = Find(orgId);
|
||||
var categories = _repository.Find(u => u.CascadeId.Contains(category.CascadeId)).Select(u => u.Id).ToArray();
|
||||
return categories;
|
||||
}
|
||||
|
||||
public Category Find(Guid id)
|
||||
public Category Find(string id)
|
||||
{
|
||||
var category = _repository.FindSingle(u => u.Id == id);
|
||||
if (category == null) return new Category();
|
||||
@@ -98,7 +96,7 @@ namespace OpenAuth.App
|
||||
return category;
|
||||
}
|
||||
|
||||
public void Delete(Guid[] ids)
|
||||
public void Delete(string[] ids)
|
||||
{
|
||||
_repository.Delete(u =>ids.Contains(u.Id));
|
||||
}
|
||||
@@ -109,7 +107,7 @@ namespace OpenAuth.App
|
||||
model.CopyTo(category);
|
||||
ChangeModuleCascade(category);
|
||||
|
||||
if (category.Id == Guid.Empty)
|
||||
if (category.Id == string.Empty)
|
||||
{
|
||||
_repository.Add(category);
|
||||
}
|
||||
@@ -145,7 +143,7 @@ namespace OpenAuth.App
|
||||
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
||||
}
|
||||
|
||||
if (org.ParentId != null && org.ParentId != Guid.Empty)
|
||||
if (org.ParentId != null && org.ParentId != string.Empty)
|
||||
{
|
||||
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
||||
if (parentOrg != null)
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace OpenAuth.App.Extention
|
||||
/// <summary>
|
||||
/// GUID
|
||||
/// </summary>
|
||||
public Guid processId { get; set; }
|
||||
public string processId { get; set; }
|
||||
/// <summary>
|
||||
/// 工作流模板内容
|
||||
/// </summary>
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenAuth.App
|
||||
_moduleEleManService.AddOrUpdate(newbtn);
|
||||
}
|
||||
|
||||
public IEnumerable<ModuleElement> LoadByModuleId(Guid id)
|
||||
public IEnumerable<ModuleElement> LoadByModuleId(string id)
|
||||
{
|
||||
string username = AuthUtil.GetUserName();
|
||||
return _moduleEleManService.LoadByModuleId(username, id);
|
||||
@@ -56,13 +56,13 @@ namespace OpenAuth.App
|
||||
/// 当为UserElement时,表示UserId
|
||||
/// </param>
|
||||
/// <param name="moduleId">模块ID</param>
|
||||
public List<dynamic> LoadWithAccess(string accessType, Guid firstId, Guid moduleId)
|
||||
public List<dynamic> LoadWithAccess(string accessType, string firstId, string moduleId)
|
||||
{
|
||||
string username = AuthUtil.GetUserName();
|
||||
return _moduleEleManService.LoadWithAccess(username, accessType, firstId, moduleId);
|
||||
}
|
||||
|
||||
public void Delete(Guid[] objs)
|
||||
public void Delete(string[] objs)
|
||||
{
|
||||
_moduleEleManService.Delete(objs);
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个节点下面的所有
|
||||
/// </summary>
|
||||
public dynamic Load(Guid parentId, int pageindex, int pagesize)
|
||||
public dynamic Load(string parentId, int pageindex, int pagesize)
|
||||
{
|
||||
return _moduleManService.Load(AuthUtil.GetUserName(), parentId, pageindex, pagesize);
|
||||
}
|
||||
|
||||
public void Delete(Guid id)
|
||||
public void Delete(string id)
|
||||
{
|
||||
_moduleManService.Delete(id);
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace OpenAuth.App
|
||||
/// TODO:这里会加载用户及用户角色的所有模块,“为用户分配模块”功能会给人一种混乱的感觉,但可以接受
|
||||
/// </summary>
|
||||
/// <param name="userId">The user unique identifier.</param>
|
||||
public List<Module> LoadForUser(Guid userId)
|
||||
public List<Module> LoadForUser(string userId)
|
||||
{
|
||||
return _moduleManService.LoadForUser(userId);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ namespace OpenAuth.App
|
||||
/// 加载特定角色的模块
|
||||
/// </summary>
|
||||
/// <param name="roleId">The role unique identifier.</param>
|
||||
public List<Module> LoadForRole(Guid roleId)
|
||||
public List<Module> LoadForRole(string roleId)
|
||||
{
|
||||
return _moduleManService.LoadForRole(roleId);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="orgId">The org unique identifier.</param>
|
||||
/// <returns>IEnumerable{Org}.</returns>
|
||||
public IList<Org> LoadDirectChildren(Guid orgId)
|
||||
public IList<Org> LoadDirectChildren(string orgId)
|
||||
{
|
||||
return _repository.Find(u => u.ParentId == orgId).ToList();
|
||||
}
|
||||
@@ -38,7 +38,7 @@ namespace OpenAuth.App
|
||||
/// 得到部门的所有子部门
|
||||
/// <para>如果orgId为0,表示取得所有部门</para>
|
||||
/// </summary>
|
||||
public GridData LoadAllChildren(Guid orgId)
|
||||
public GridData LoadAllChildren(string orgId)
|
||||
{
|
||||
var query = _repository.GetSubOrgs(orgId);
|
||||
return new GridData
|
||||
@@ -57,10 +57,10 @@ namespace OpenAuth.App
|
||||
/// <param name="org">The org.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
/// <exception cref="System.Exception">未能找到该组织的父节点信息</exception>
|
||||
public Guid AddOrUpdate(Org org)
|
||||
public string AddOrUpdate(Org org)
|
||||
{
|
||||
ChangeModuleCascade(org);
|
||||
if (org.Id == Guid.Empty)
|
||||
if (org.Id == string.Empty)
|
||||
{
|
||||
_repository.Add(org);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 删除指定ID的部门及其所有子部门
|
||||
/// </summary>
|
||||
public void DelOrg(Guid[] ids)
|
||||
public void DelOrg(string[] ids)
|
||||
{
|
||||
var delOrg = _repository.Find(u => ids.Contains(u.Id)).ToList();
|
||||
foreach (var org in delOrg)
|
||||
@@ -103,7 +103,7 @@ namespace OpenAuth.App
|
||||
/// TODO:这里会加载用户及用户角色的所有角色,“为用户分配角色”功能会给人一种混乱的感觉,但可以接受
|
||||
/// </summary>
|
||||
/// <param name="userId">The user unique identifier.</param>
|
||||
public List<Org> LoadForUser(Guid userId)
|
||||
public List<Org> LoadForUser(string userId)
|
||||
{
|
||||
//用户角色
|
||||
var userRoleIds =
|
||||
@@ -124,7 +124,7 @@ namespace OpenAuth.App
|
||||
/// 加载特定角色的角色
|
||||
/// </summary>
|
||||
/// <param name="roleId">The role unique identifier.</param>
|
||||
public List<Org> LoadForRole(Guid roleId)
|
||||
public List<Org> LoadForRole(string roleId)
|
||||
{
|
||||
var moduleIds =
|
||||
_relevanceRepository.Find(u => u.FirstId == roleId && u.Key == "RoleOrg")
|
||||
@@ -148,7 +148,7 @@ namespace OpenAuth.App
|
||||
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
||||
}
|
||||
|
||||
if (org.ParentId != null && org.ParentId != Guid.Empty)
|
||||
if (org.ParentId != null && org.ParentId != string.Empty)
|
||||
{
|
||||
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
||||
if (parentOrg != null)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenAuth.App
|
||||
_resManagerService = resManagerService;
|
||||
}
|
||||
|
||||
public int GetResourceCntInOrg(Guid orgId)
|
||||
public int GetResourceCntInOrg(string orgId)
|
||||
{
|
||||
return _resManagerService.GetResourceCntInOrg(orgId);
|
||||
}
|
||||
@@ -32,14 +32,14 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个节点下面的一个或全部Resources
|
||||
/// </summary>
|
||||
public dynamic Load(string username, Guid categoryId, int pageindex, int pagesize)
|
||||
public dynamic Load(string username, string categoryId, int pageindex, int pagesize)
|
||||
{
|
||||
return _resManagerService.Load(username, categoryId, pageindex, pagesize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Delete(Guid[] ids)
|
||||
public void Delete(string[] ids)
|
||||
{
|
||||
_resManagerService.Delete(ids);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace OpenAuth.App
|
||||
/// 当为UserResource时,表示UserId
|
||||
/// </param>
|
||||
/// <param name="cId">分类ID</param>
|
||||
public List<dynamic> LoadWithAccess(string username, string accessType, Guid firstId, Guid cId)
|
||||
public List<dynamic> LoadWithAccess(string username, string accessType, string firstId, string cId)
|
||||
{
|
||||
return _resManagerService.LoadWithAccess(username, accessType, firstId, cId);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenAuth.App
|
||||
/// <para>比如给用户分配资源,那么firstId就是用户ID,secIds就是资源ID列表</para>
|
||||
/// </summary>
|
||||
/// <param name="type">关联的类型,如"UserResource"</param>
|
||||
public void Assign(string type, Guid firstId, Guid[] secIds)
|
||||
public void Assign(string type, string firstId, string[] secIds)
|
||||
{
|
||||
_relevanceRepository.AddRelevance(type, secIds.ToLookup(u => firstId));
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace OpenAuth.App
|
||||
/// <param name="type">关联的类型,如"UserResource"</param>
|
||||
/// <param name="firstId">The first identifier.</param>
|
||||
/// <param name="secIds">The sec ids.</param>
|
||||
public void UnAssign(string type, Guid firstId, Guid[] secIds)
|
||||
public void UnAssign(string type, string firstId, string[] secIds)
|
||||
{
|
||||
_relevanceRepository.DeleteBy(type, secIds.ToLookup(u =>firstId));
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace OpenAuth.App
|
||||
_relevanceRepository = relevanceRepository;
|
||||
}
|
||||
|
||||
public int GetRoleCntInOrg(Guid orgId)
|
||||
public int GetRoleCntInOrg(string orgId)
|
||||
{
|
||||
if (orgId == Guid.Empty)
|
||||
if (orgId == string.Empty)
|
||||
{
|
||||
return _repository.Find(null).Count();
|
||||
}
|
||||
@@ -39,12 +39,12 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个部门及子部门全部Roles
|
||||
/// </summary>
|
||||
public GridData Load(Guid orgId, int pageindex, int pagesize)
|
||||
public GridData Load(string orgId, int pageindex, int pagesize)
|
||||
{
|
||||
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
||||
IEnumerable<Role> roles;
|
||||
int total = 0;
|
||||
if (orgId == Guid.Empty)
|
||||
if (orgId == string.Empty)
|
||||
{
|
||||
roles = _repository.LoadRoles(pageindex, pagesize);
|
||||
total = _repository.GetCount();
|
||||
@@ -79,20 +79,20 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 获取当前组织的所有下级组织
|
||||
/// </summary>
|
||||
private Guid[] GetSubOrgIds(Guid orgId)
|
||||
private string[] GetSubOrgIds(string orgId)
|
||||
{
|
||||
var orgs = _orgRepository.GetSubOrgs(orgId).Select(u => u.Id).ToArray();
|
||||
return orgs;
|
||||
}
|
||||
|
||||
public Role Find(Guid id)
|
||||
public Role Find(string id)
|
||||
{
|
||||
var role = _repository.FindSingle(u => u.Id == id);
|
||||
if (role == null) role = new Role();
|
||||
return role;
|
||||
}
|
||||
|
||||
public void Delete(Guid id)
|
||||
public void Delete(string id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace OpenAuth.App
|
||||
public void AddOrUpdate(JObject obj)
|
||||
{
|
||||
var role = obj.ToObject<Role>();
|
||||
if (role.Id == Guid.Empty)
|
||||
if (role.Id == string.Empty)
|
||||
{
|
||||
role.CreateTime = DateTime.Now;
|
||||
_repository.Add(role);
|
||||
@@ -110,18 +110,18 @@ namespace OpenAuth.App
|
||||
_repository.Update(role);
|
||||
}
|
||||
|
||||
Guid[] orgIds = obj["OrganizationIds"].ToString().Split(',').Select(id => Guid.Parse(id)).ToArray();
|
||||
string[] orgIds = obj["OrganizationIds"].ToString().Split(',').ToArray();
|
||||
|
||||
_relevanceRepository.DeleteBy("RoleOrg", role.Id);
|
||||
_relevanceRepository.AddRelevance("RoleOrg", orgIds.ToLookup(u => role.Id));
|
||||
}
|
||||
|
||||
public List<Role> LoadForUser(Guid userId)
|
||||
public List<Role> LoadForUser(string userId)
|
||||
{
|
||||
return _repository.LoadForUser(userId).ToList();
|
||||
}
|
||||
|
||||
public List<RoleVM> LoadForOrgAndUser(Guid orgId, Guid userId)
|
||||
public List<RoleVM> LoadForOrgAndUser(string orgId, string userId)
|
||||
{
|
||||
var userroles = LoadForUser(userId);
|
||||
var orgroles = _repository.LoadInOrgs(GetSubOrgIds(orgId)).ToList();
|
||||
@@ -139,7 +139,7 @@ namespace OpenAuth.App
|
||||
return rolevms;
|
||||
}
|
||||
|
||||
public List<Guid> GetUsersInRole(string ruleName)
|
||||
public List<string> GetUsersInRole(string ruleName)
|
||||
{
|
||||
var role = _repository.FindSingle(u => u.Name == ruleName);
|
||||
if (role == null) return null;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenAuth.App.SSO
|
||||
{
|
||||
userInfo = new User
|
||||
{
|
||||
Id = Guid.Empty,
|
||||
Id = string.Empty,
|
||||
Account = "System",
|
||||
Name ="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա",
|
||||
Password = "123456"
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 根据部门ID得到进出库信息
|
||||
/// </summary>
|
||||
public dynamic Load(string username, Guid orgId, int page, int rows)
|
||||
public dynamic Load(string username, string orgId, int page, int rows)
|
||||
{
|
||||
return _service.Load(username, orgId, page, rows);
|
||||
}
|
||||
|
||||
public void Delete(Guid[] id)
|
||||
public void Delete(string[] id)
|
||||
{
|
||||
_service.Delete(id);
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ namespace OpenAuth.App
|
||||
return _repository.FindSingle(u => u.Account == account);
|
||||
}
|
||||
|
||||
public int GetUserCntInOrg(Guid orgId)
|
||||
public int GetUserCntInOrg(string orgId)
|
||||
{
|
||||
if (orgId == Guid.Empty)
|
||||
if (orgId == string.Empty)
|
||||
{
|
||||
return _repository.Find(null).Count();
|
||||
}
|
||||
@@ -43,12 +43,12 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 加载一个部门及子部门全部用户
|
||||
/// </summary>
|
||||
public GridData Load(Guid orgId, int pageindex, int pagesize)
|
||||
public GridData Load(string orgId, int pageindex, int pagesize)
|
||||
{
|
||||
if (pageindex < 1) pageindex = 1; //TODO:如果列表为空新增加一个用户后,前端会传一个0过来,奇怪??
|
||||
IEnumerable<User> users;
|
||||
int records = 0;
|
||||
if (orgId ==Guid.Empty)
|
||||
if (orgId ==string.Empty)
|
||||
{
|
||||
users = _repository.LoadUsers(pageindex, pagesize);
|
||||
records = _repository.GetCount();
|
||||
@@ -81,14 +81,14 @@ namespace OpenAuth.App
|
||||
/// <summary>
|
||||
/// 获取当前组织的所有下级组织
|
||||
/// </summary>
|
||||
private Guid[] GetSubOrgIds(Guid orgId)
|
||||
private string[] GetSubOrgIds(string orgId)
|
||||
{
|
||||
var org = _orgRepository.FindSingle(u => u.Id == orgId);
|
||||
var orgs = _orgRepository.Find(u => u.CascadeId.Contains(org.CascadeId)).Select(u => u.Id).ToArray();
|
||||
return orgs;
|
||||
}
|
||||
|
||||
public UserView Find(Guid id)
|
||||
public UserView Find(string id)
|
||||
{
|
||||
var user = _repository.FindSingle(u => u.Id == id);
|
||||
if (user == null) return new UserView();
|
||||
@@ -104,7 +104,7 @@ namespace OpenAuth.App
|
||||
return view;
|
||||
}
|
||||
|
||||
public void Delete(Guid[] ids)
|
||||
public void Delete(string[] ids)
|
||||
{
|
||||
_repository.Delete(u => ids.Contains(u.Id));
|
||||
_relevanceRepository.DeleteBy("UserOrg", ids);
|
||||
@@ -117,7 +117,7 @@ namespace OpenAuth.App
|
||||
if (string.IsNullOrEmpty(view.OrganizationIds))
|
||||
throw new Exception("请为用户分配机构");
|
||||
User user = view;
|
||||
if (user.Id == Guid.Empty)
|
||||
if (user.Id == string.Empty)
|
||||
{
|
||||
if (_repository.IsExist(u => u.Account == view.Account))
|
||||
{
|
||||
@@ -140,13 +140,13 @@ namespace OpenAuth.App
|
||||
Type = user.Type
|
||||
});
|
||||
}
|
||||
Guid[] orgIds = view.OrganizationIds.Split(',').Select(id => Guid.Parse(id)).ToArray();
|
||||
string[] orgIds = view.OrganizationIds.Split(',').ToArray();
|
||||
|
||||
_relevanceRepository.DeleteBy("UserOrg", user.Id);
|
||||
_relevanceRepository.AddRelevance("UserOrg", orgIds.ToLookup(u => user.Id));
|
||||
}
|
||||
|
||||
public IEnumerable<User> GetUsers(IEnumerable<Guid> userids)
|
||||
public IEnumerable<User> GetUsers(IEnumerable<string> userids)
|
||||
{
|
||||
return _repository.Find(u => userids.Contains(u.Id));
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace OpenAuth.App.ViewModel
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Guid Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
@@ -29,7 +29,7 @@ namespace OpenAuth.App.ViewModel
|
||||
/// 父节点流水号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Guid? ParentId { get; set; }
|
||||
public string ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点图标文件名称
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenAuth.App.ViewModel
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Guid Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace OpenAuth.App.ViewModel
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Guid Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -25,12 +25,12 @@ namespace OpenAuth.App
|
||||
return _unitWork.Find<WFFrmMain>(null).ToList();
|
||||
}
|
||||
|
||||
public WFFrmMain GetForm(Guid keyValue)
|
||||
public WFFrmMain GetForm(string keyValue)
|
||||
{
|
||||
return _unitWork.FindSingle<WFFrmMain>(u => u.Id == keyValue);
|
||||
}
|
||||
|
||||
public void RemoveForm(Guid[] keyValue)
|
||||
public void RemoveForm(string[] keyValue)
|
||||
{
|
||||
_unitWork.Delete<WFFrmMain>(u =>keyValue.Contains(u.Id));
|
||||
}
|
||||
@@ -58,7 +58,7 @@ namespace OpenAuth.App
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.Id = Guid.Parse(keyValue);
|
||||
entity.Id = keyValue;
|
||||
_unitWork.Update(u =>u.Id, entity);
|
||||
}
|
||||
_unitWork.Save();
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="keyVlaue"></param>
|
||||
/// <returns></returns>
|
||||
public WFProcessInstance GetEntity(Guid keyVlaue)
|
||||
public WFProcessInstance GetEntity(string keyVlaue)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -50,11 +50,11 @@ namespace OpenAuth.App
|
||||
/// <param name="processSchemeEntity"></param>
|
||||
/// <param name="wfOperationHistoryEntity"></param>
|
||||
/// <returns></returns>
|
||||
public int SaveProcess(Guid processId, WFProcessInstance processInstanceEntity, WFProcessScheme processSchemeEntity, WFProcessOperationHistory wfOperationHistoryEntity = null)
|
||||
public int SaveProcess(string processId, WFProcessInstance processInstanceEntity, WFProcessScheme processSchemeEntity, WFProcessOperationHistory wfOperationHistoryEntity = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Guid.Empty ==(processInstanceEntity.Id))
|
||||
if (string.Empty ==(processInstanceEntity.Id))
|
||||
{
|
||||
_unitWork.Add(processSchemeEntity);
|
||||
|
||||
@@ -97,13 +97,13 @@ namespace OpenAuth.App
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Guid.Empty == (processInstanceEntity.Id))
|
||||
if (string.Empty == (processInstanceEntity.Id))
|
||||
{
|
||||
processSchemeEntity.Create();
|
||||
_unitWork.Add(processSchemeEntity);
|
||||
|
||||
processInstanceEntity.Create();
|
||||
processInstanceEntity.Id = Guid.Parse(wfRuntimeModel.processId);
|
||||
processInstanceEntity.Id = (string)(wfRuntimeModel.processId);
|
||||
processInstanceEntity.ProcessSchemeId = processSchemeEntity.Id;
|
||||
_unitWork.Add(processInstanceEntity);
|
||||
}
|
||||
@@ -211,7 +211,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="keyValue">主键</param>
|
||||
/// <returns></returns>
|
||||
public int DeleteProcess(Guid keyValue)
|
||||
public int DeleteProcess(string keyValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -232,7 +232,7 @@ namespace OpenAuth.App
|
||||
/// <param name="keyValue"></param>
|
||||
/// <param name="state">0暂停,1启用,2取消(召回)</param>
|
||||
/// <returns></returns>
|
||||
public int OperateVirtualProcess(Guid keyValue,int state)
|
||||
public int OperateVirtualProcess(string keyValue,int state)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -288,7 +288,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="processId"></param>
|
||||
/// <param name="makeLists"></param>
|
||||
public void DesignateProcess(Guid processId, string makeLists)
|
||||
public void DesignateProcess(string processId, string makeLists)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -345,7 +345,7 @@ namespace OpenAuth.App
|
||||
/// <param name="description">备注</param>
|
||||
/// <param name="frmData">表单数据信息</param>
|
||||
/// <returns></returns>
|
||||
public bool CreateInstance(Guid processId, Guid schemeInfoId, WFProcessInstance WFProcessInstance, string frmData = null)
|
||||
public bool CreateInstance(string processId, string schemeInfoId, WFProcessInstance WFProcessInstance, string frmData = null)
|
||||
{
|
||||
|
||||
try
|
||||
@@ -441,7 +441,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="processId"></param>
|
||||
/// <returns></returns>
|
||||
public bool NodeVerification(Guid processId, bool flag, string description = "")
|
||||
public bool NodeVerification(string processId, bool flag, string description = "")
|
||||
{
|
||||
bool _res = false;
|
||||
try
|
||||
@@ -620,7 +620,7 @@ namespace OpenAuth.App
|
||||
/// <param name="nodeId"></param>
|
||||
/// <param name="description"></param>
|
||||
/// <returns></returns>
|
||||
public bool NodeReject(Guid processId, string nodeId, string description = "")
|
||||
public bool NodeReject(string processId, string nodeId, string description = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -690,7 +690,7 @@ namespace OpenAuth.App
|
||||
/// 召回流程进程
|
||||
/// </summary>
|
||||
/// <param name="processId"></param>
|
||||
public void CallingBackProcess(Guid processId)
|
||||
public void CallingBackProcess(string processId)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -706,7 +706,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="processId"></param>
|
||||
/// <returns></returns>
|
||||
public void KillProcess(Guid processId)
|
||||
public void KillProcess(string processId)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -989,7 +989,7 @@ namespace OpenAuth.App
|
||||
return resStr;
|
||||
}
|
||||
|
||||
public WFProcessScheme GetProcessSchemeEntity(Guid keyValue)
|
||||
public WFProcessScheme GetProcessSchemeEntity(string keyValue)
|
||||
{
|
||||
return _unitWork.FindSingle<WFProcessScheme>(u => u.Id == keyValue);
|
||||
}
|
||||
@@ -1000,7 +1000,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="keyValue">The key value.</param>
|
||||
/// <returns>WFProcessScheme.</returns>
|
||||
public WFProcessScheme GetProcessSchemeByUserId(Guid keyValue)
|
||||
public WFProcessScheme GetProcessSchemeByUserId(string keyValue)
|
||||
{
|
||||
var entity = GetProcessSchemeEntity(keyValue);
|
||||
entity.SchemeContent = GetProcessSchemeContentByUserId(entity.SchemeContent, AuthUtil.GetCurrentUser().User.Id.ToString());
|
||||
@@ -1015,14 +1015,14 @@ namespace OpenAuth.App
|
||||
/// <param name="keyValue">The key value.</param>
|
||||
/// <param name="nodeId">The node identifier.</param>
|
||||
/// <returns>WFProcessScheme.</returns>
|
||||
public WFProcessScheme GetProcessSchemeEntityByNodeId(Guid keyValue, string nodeId)
|
||||
public WFProcessScheme GetProcessSchemeEntityByNodeId(string keyValue, string nodeId)
|
||||
{
|
||||
var entity = GetProcessSchemeEntity(keyValue);
|
||||
entity.SchemeContent = GetProcessSchemeContentByNodeId(entity.SchemeContent, nodeId);
|
||||
return entity;
|
||||
}
|
||||
|
||||
public WFProcessInstance GetProcessInstanceEntity(Guid keyValue)
|
||||
public WFProcessInstance GetProcessInstanceEntity(string keyValue)
|
||||
{
|
||||
return _unitWork.FindSingle<WFProcessInstance>(u => u.Id == keyValue);
|
||||
}
|
||||
@@ -1033,7 +1033,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="processId">The process identifier.</param>
|
||||
/// <param name="verificationData">The verification data.</param>
|
||||
public void VerificationProcess(Guid processId, string verificationData)
|
||||
public void VerificationProcess(string processId, string verificationData)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenAuth.App
|
||||
}
|
||||
else
|
||||
{
|
||||
Guid schemeid = Guid.Parse(keyValue);
|
||||
string schemeid = (string)(keyValue);
|
||||
WFSchemeContent modelentityold =
|
||||
_unitWork.FindSingle<WFSchemeContent>(u => u.SchemeVersion == entity.SchemeVersion
|
||||
&& u.SchemeInfoId == schemeid);
|
||||
@@ -66,7 +66,7 @@ namespace OpenAuth.App
|
||||
{
|
||||
modelentity.SchemeVersion = modelentityold.SchemeVersion;
|
||||
}
|
||||
entity.Id = Guid.Parse(keyValue);
|
||||
entity.Id = keyValue;
|
||||
entity.SchemeVersion = modelentity.SchemeVersion;
|
||||
_unitWork.Update(entity);
|
||||
}
|
||||
@@ -80,18 +80,18 @@ namespace OpenAuth.App
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveForm(Guid[] keyValue)
|
||||
public void RemoveForm(string[] keyValue)
|
||||
{
|
||||
_unitWork.Delete<WFSchemeInfo>(u =>keyValue.Contains(u.Id));
|
||||
_unitWork.Delete<WFSchemeContent>(u =>keyValue.Contains(u.SchemeInfoId));
|
||||
}
|
||||
|
||||
public WFSchemeInfo GetEntity(Guid keyValue)
|
||||
public WFSchemeInfo GetEntity(string keyValue)
|
||||
{
|
||||
return _unitWork.FindSingle<WFSchemeInfo>(u => u.Id == keyValue);
|
||||
}
|
||||
|
||||
public WFSchemeContent GetSchemeEntity(Guid schemeinfoId, string schemeinfoSchemeVersion)
|
||||
public WFSchemeContent GetSchemeEntity(string schemeinfoId, string schemeinfoSchemeVersion)
|
||||
{
|
||||
return _unitWork.FindSingle<WFSchemeContent>(u =>
|
||||
u.SchemeInfoId == schemeinfoId && u.SchemeVersion == schemeinfoSchemeVersion);
|
||||
|
||||
Reference in New Issue
Block a user