Merge branch 'Insight' of http://123.132.248.154:10000/HC_YFZX/Infrastructure into Insight
commit
aafef20357
|
|
@ -13,9 +13,11 @@ namespace OpenAuth.App
|
||||||
public class CategoryApp : SqlSugarBaseApp<SysCategory, SugarDbContext>
|
public class CategoryApp : SqlSugarBaseApp<SysCategory, SugarDbContext>
|
||||||
{
|
{
|
||||||
private DbExtension extension;
|
private DbExtension extension;
|
||||||
public CategoryApp(ISugarUnitOfWork<SugarDbContext> unitWork, ISimpleClient<SysCategory> repository, IAuth auth, DbExtension dbExtension) : base(unitWork, repository, auth)
|
private readonly ISqlSugarClient client;
|
||||||
|
public CategoryApp(ISugarUnitOfWork<SugarDbContext> unitWork, ISimpleClient<SysCategory> repository, IAuth auth, DbExtension dbExtension, ISqlSugarClient client) : base(unitWork, repository, auth)
|
||||||
{
|
{
|
||||||
extension = dbExtension;
|
extension = dbExtension;
|
||||||
|
this.client = client;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载列表
|
/// 加载列表
|
||||||
|
|
@ -113,5 +115,36 @@ namespace OpenAuth.App
|
||||||
{
|
{
|
||||||
return Repository.GetById(id);
|
return Repository.GetById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 原航飞库
|
||||||
|
/// <summary>
|
||||||
|
/// 获取字典
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="typeid"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<OpenAuth.App.Request.Category> LoadList(string typeid)
|
||||||
|
{
|
||||||
|
var list = client.Queryable<SysDataItemDetail>().Where(c => c.ItemCode == typeid).OrderByDescending(c => c.CreateDate)
|
||||||
|
.Select(c => new App.Request.Category
|
||||||
|
{
|
||||||
|
Id = c.ItemDetailId,
|
||||||
|
Name = c.ItemName,
|
||||||
|
DtCode = c.ItemCode,
|
||||||
|
DtValue = c.ItemValue,
|
||||||
|
SortNo = c.SortCode,
|
||||||
|
Description = c.Description,
|
||||||
|
Enable = c.EnabledMark,
|
||||||
|
TypeId = c.ItemCode,
|
||||||
|
CreateTime = c.CreateDate,
|
||||||
|
CreateUserId = c.CreateUserId,
|
||||||
|
CreateUserName = c.CreateUserName,
|
||||||
|
UpdateTime = c.ModifyDate,
|
||||||
|
UpdateUserId = c.ModifyUserId,
|
||||||
|
UpdateUserName = c.ModifyUserName
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -627,7 +627,45 @@ namespace OpenAuth.App
|
||||||
base.Repository.AsSugarClient().Updateable<SysOrg>(obj).ExecuteCommand();
|
base.Repository.AsSugarClient().Updateable<SysOrg>(obj).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region
|
||||||
|
/// <summary>
|
||||||
|
/// 组织机构列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<SysOrg> LoadOrgList(string name)
|
||||||
|
{
|
||||||
|
List<SysOrg> resultList = new List<SysOrg>();
|
||||||
|
|
||||||
|
var model = client.Queryable<SysOrg>().Where(c => c.Name == name).First();
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
throw new System.Exception("找不到数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询所有子级
|
||||||
|
var list = client.Queryable<SysOrg>().OrderBy(c => c.SortNo).ToChildList(c => c.ParentId, model.Id).ToList();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询组织机构对应的数据库和图片列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="req"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabasePicture> LoadDataBase(QueryOrgRelDataBaseReq req)
|
||||||
|
{
|
||||||
|
int total = 0;
|
||||||
|
var list = client.Queryable<DatabasePicture>()
|
||||||
|
//数据库名称过滤
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.dataBaseName), c => c.database_name == req.dataBaseName)
|
||||||
|
//组织机构名称过滤
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.orgid), c => c.org_id.Contains(req.orgid))
|
||||||
|
.ToPageList(req.page, req.limit, ref total);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace OpenAuth.App.ServiceApp.Category
|
|
||||||
{
|
|
||||||
public class CategoryApp
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
using OpenAuth.App.BaseApp.Base;
|
||||||
|
using OpenAuth.Repository.Domain;
|
||||||
|
using OpenAuth.Repository;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using OpenAuth.App.Interface;
|
||||||
|
using SqlSugar;
|
||||||
|
using Infrastructure.Extensions;
|
||||||
|
using Infrastructure;
|
||||||
|
using OpenAuth.App.Request;
|
||||||
|
using OpenAuth.App.Response;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.ServiceApp.Category
|
||||||
|
{
|
||||||
|
public class CategoryItemApp : SqlSugarBaseApp<SysDataItem, SugarDbContext>
|
||||||
|
{
|
||||||
|
private readonly ISqlSugarClient client;
|
||||||
|
public CategoryItemApp(ISugarUnitOfWork<SugarDbContext> unitWork, ISimpleClient<SysDataItem> repository, IAuth auth, ISqlSugarClient sqlSugarClient) : base(unitWork, repository, auth)
|
||||||
|
{
|
||||||
|
this.client = sqlSugarClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取字典
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="typeid"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<OpenAuth.App.Request.Category> LoadList(string typeid)
|
||||||
|
{
|
||||||
|
var list = client.Queryable<SysDataItemDetail>().Where(c => c.ItemCode == typeid).OrderByDescending(c => c.CreateDate)
|
||||||
|
.Select(c=>new App.Request.Category
|
||||||
|
{
|
||||||
|
Id=c.ItemDetailId,
|
||||||
|
Name=c.ItemName,
|
||||||
|
DtCode=c.ItemCode,
|
||||||
|
DtValue=c.ItemValue,
|
||||||
|
SortNo=c.SortCode,
|
||||||
|
Description=c.Description,
|
||||||
|
Enable=c.EnabledMark,
|
||||||
|
TypeId=c.ItemCode,
|
||||||
|
CreateTime=c.CreateDate,
|
||||||
|
CreateUserId=c.CreateUserId,
|
||||||
|
CreateUserName=c.CreateUserName,
|
||||||
|
UpdateTime=c.ModifyDate,
|
||||||
|
UpdateUserId=c.ModifyUserId,
|
||||||
|
UpdateUserName=c.ModifyUserName
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region
|
||||||
|
/// <summary>
|
||||||
|
/// 组织机构列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<SysOrg> LoadOrgList(string name)
|
||||||
|
{
|
||||||
|
List<SysOrg> resultList = new List<SysOrg>();
|
||||||
|
|
||||||
|
var model = client.Queryable<SysOrg>().Where(c => c.Name == name).First();
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
throw new System.Exception("找不到数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询所有子级
|
||||||
|
var list = client.Queryable<SysOrg>().OrderBy(c => c.SortNo).ToChildList(c => c.ParentId, model.Id).ToList();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询组织机构对应的数据库和图片列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="req"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabasePicture> LoadDataBase(QueryOrgRelDataBaseReq req)
|
||||||
|
{
|
||||||
|
int total = 0;
|
||||||
|
var list = client.Queryable<DatabasePicture>()
|
||||||
|
//数据库名称过滤
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.dataBaseName), c => c.database_name == req.dataBaseName)
|
||||||
|
//组织机构名称过滤
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(req.orgid), c => c.org_id.Contains(req.orgid))
|
||||||
|
.ToPageList(req.page, req.limit, ref total);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ namespace OpenAuth.App.Request
|
||||||
/// Default:CURRENT_TIMESTAMP
|
/// Default:CURRENT_TIMESTAMP
|
||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:创建人ID
|
/// Desc:创建人ID
|
||||||
|
|
@ -56,7 +56,7 @@ namespace OpenAuth.App.Request
|
||||||
/// Default:0
|
/// Default:0
|
||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public byte Enable { get; set; }
|
public int? Enable { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:
|
/// Desc:
|
||||||
|
|
@ -77,7 +77,7 @@ namespace OpenAuth.App.Request
|
||||||
/// Default:0
|
/// Default:0
|
||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SortNo { get; set; }
|
public int? SortNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:
|
/// Desc:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.ServiceApp.Category.Request
|
||||||
|
{
|
||||||
|
public class Orgs
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
public string CascadeId { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string HotKey { get; set; }
|
||||||
|
public string ParentName { get; set; }
|
||||||
|
public int? IsLeaf { get; set; }
|
||||||
|
public int? IsAutoExpand { get; set; }
|
||||||
|
public string IconName { get; set; }
|
||||||
|
public int? Status { get; set; }
|
||||||
|
public string BizCode { get; set; }
|
||||||
|
public string CustomCode { get; set; }
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
public int? CreateId { get; set; }
|
||||||
|
public int? SortNo { get; set; }
|
||||||
|
public string ParentId { get; set; }
|
||||||
|
public string TypeName { get; set; }
|
||||||
|
public string TypeId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using OpenAuth.App.BaseApp.Base;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.Request
|
||||||
|
{
|
||||||
|
public class QueryOrgRelDataBaseReq : PageReq
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 数据库名称
|
||||||
|
/// </summary>
|
||||||
|
public string dataBaseName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 组织机构id
|
||||||
|
/// </summary>
|
||||||
|
public string orgid { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -232,7 +232,7 @@ namespace OpenAuth.App.ServiceApp.InsTaskHallManager
|
||||||
{
|
{
|
||||||
throw new Exception("登录失效");
|
throw new Exception("登录失效");
|
||||||
}
|
}
|
||||||
|
var taskId = "";
|
||||||
using(var uwo = UnitWork.CreateContext())
|
using(var uwo = UnitWork.CreateContext())
|
||||||
{
|
{
|
||||||
foreach (var item in groupIds)
|
foreach (var item in groupIds)
|
||||||
|
|
@ -241,6 +241,7 @@ namespace OpenAuth.App.ServiceApp.InsTaskHallManager
|
||||||
if (taskGroup != null&&taskGroup.ReciveUserId==null)
|
if (taskGroup != null&&taskGroup.ReciveUserId==null)
|
||||||
{
|
{
|
||||||
var task = await client.Queryable<InsTask>().Where(t => t.Id == taskGroup.TaskId).FirstAsync();
|
var task = await client.Queryable<InsTask>().Where(t => t.Id == taskGroup.TaskId).FirstAsync();
|
||||||
|
taskId = task.Id;
|
||||||
if(task != null)
|
if(task != null)
|
||||||
{
|
{
|
||||||
//查询并判断任务是否领完
|
//查询并判断任务是否领完
|
||||||
|
|
@ -274,7 +275,7 @@ namespace OpenAuth.App.ServiceApp.InsTaskHallManager
|
||||||
var flag = uwo.Commit();
|
var flag = uwo.Commit();
|
||||||
var content = new
|
var content = new
|
||||||
{
|
{
|
||||||
queryid = groupIds,
|
queryid = taskId,
|
||||||
message = "有新接手的任务"
|
message = "有新接手的任务"
|
||||||
};
|
};
|
||||||
var contents = Json.ToJson(content);
|
var contents = Json.ToJson(content);
|
||||||
|
|
|
||||||
|
|
@ -126,5 +126,29 @@ namespace OpenAuth.WebApi.Controllers
|
||||||
{
|
{
|
||||||
_app = app;
|
_app = app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region
|
||||||
|
/// <summary>
|
||||||
|
/// 获取字典
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="typeid"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public Response<List<Category>> LoadList(string typeid)
|
||||||
|
{
|
||||||
|
Response<List<Category>> response = new Response<List<Category>>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response.Result = _app.LoadList(typeid);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
response.Code = 500;
|
||||||
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using OpenAuth.App;
|
using OpenAuth.App;
|
||||||
using OpenAuth.App.Request;
|
using OpenAuth.App.Request;
|
||||||
using OpenAuth.Repository.Core;
|
using OpenAuth.Repository.Core;
|
||||||
using OpenAuth.Repository.Domain;
|
using OpenAuth.Repository.Domain;
|
||||||
using OpenAuth.WebApi.Model.CustomAttribute;
|
using OpenAuth.WebApi.Model.CustomAttribute;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace OpenAuth.WebApi.Controllers
|
namespace OpenAuth.WebApi.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -283,5 +285,51 @@ namespace OpenAuth.WebApi.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 原航飞库
|
||||||
|
/// <summary>
|
||||||
|
/// 获取所有下级组织机构
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpGet]
|
||||||
|
public Response<List<SysOrg>> LoadOrgList(string name)
|
||||||
|
{
|
||||||
|
Response<List<SysOrg>> response = new Response<List<SysOrg>>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response.Result = _app.LoadOrgList(name);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
response.Code = 500;
|
||||||
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询组织机构绑定数据库,图片服务器列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public Response<List<DatabasePicture>> LoadDataBase([FromQuery] QueryOrgRelDataBaseReq req)
|
||||||
|
{
|
||||||
|
var res = new Response<List<DatabasePicture>>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
res.Result = _app.LoadDataBase(req);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
res.Code = 500;
|
||||||
|
res.Message = ex.InnerException?.Message ?? ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue