Commit f1863477 authored by 吴春's avatar 吴春

提交app接口

parent 882363ab
......@@ -49,6 +49,12 @@ namespace Edu.Module.User
return accountRepository.GetAccountListExtRepository(query);
}
public List<RB_Account_ViewModel> GetStudentExt(RB_Account_ViewModel query)
{
return accountRepository.GetStudentExt(query);
}
/// <summary>
/// 添加修改账号
/// </summary>
......
......@@ -107,7 +107,7 @@ WHERE 1=1
{
where2.AppendFormat(" AND p.{0}='{1}' ", nameof(RB_Account_ViewModel.PostName), query.PostName);
}
if (query.Post_Id>0)
if (query.Post_Id > 0)
{
where.AppendFormat(" AND B.{0}={1} ", nameof(RB_Account_ViewModel.Post_Id), query.Post_Id);
}
......@@ -157,6 +157,57 @@ WHERE 1=1 {1}
return list;
}
public List<RB_Account_ViewModel> GetStudentExt(RB_Account_ViewModel query)
{
StringBuilder where = new StringBuilder();
StringBuilder where2 = new StringBuilder();
if (query != null)
{
if (query.Group_Id > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrWhiteSpace(query.Account))
{
where.AppendFormat(" AND A.{0}='{1}' ", nameof(RB_Account_ViewModel.Account), query.Account.Trim());
}
if (query.AccountType > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.AccountType), (int)query.AccountType);
}
if (query.Id > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.Id), query.Id);
}
if (!string.IsNullOrEmpty(query.QIds))
{
where.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Account_ViewModel.Id), query.QIds);
}
if (query.AccountId > 0)
{
where.AppendFormat(" AND A.{0}={1} ", nameof(RB_Account_ViewModel.AccountId), query.AccountId);
}
if (!string.IsNullOrEmpty(query.OpenId))
{
where.AppendFormat(" AND A.{0}='{1}' ", nameof(RB_Account_ViewModel.OpenId), query.OpenId);
}
}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"select A.*,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName,IFNULL(G.Logo,'') AS GroupLogo
from rb_account AS A INNER JOIN rb_student AS B ON A.AccountId=B.StuId
LEFT JOIN rb_group AS g ON A.Group_Id=g.GId
LEFT JOIN rb_school AS s ON A.School_Id=s.SId where 1=1 {0}
", where.ToString());
var list = Get<RB_Account_ViewModel>(builder.ToString()).ToList();
return list;
}
/// <summary>
/// 获取账户总数量
/// </summary>
......@@ -495,9 +546,10 @@ WHERE 1=1
{
if (!string.IsNullOrWhiteSpace(builderWhere.ToString()))
{
builderWhere.AppendFormat(" or ( a.{0}={1} and a.{2}={3} ) ", nameof(RB_Account_ViewModel.AccountType),(int) item.AccountType, nameof(RB_Account_ViewModel.AccountId), item.AccountId);
builderWhere.AppendFormat(" or ( a.{0}={1} and a.{2}={3} ) ", nameof(RB_Account_ViewModel.AccountType), (int)item.AccountType, nameof(RB_Account_ViewModel.AccountId), item.AccountId);
}
else {
else
{
builderWhere.AppendFormat(" ( a.{0}={1} and a.{2}={3} ) ", nameof(RB_Account_ViewModel.AccountType), (int)item.AccountType, nameof(RB_Account_ViewModel.AccountId), item.AccountId);
}
}
......@@ -512,7 +564,8 @@ WHERE 1=1
/// </summary>
/// <param name="GroupId"></param>
/// <returns></returns>
public List<RB_Employee_Extend> GetOKRUserNotObjectiveList(int GroupId) {
public List<RB_Employee_Extend> GetOKRUserNotObjectiveList(int GroupId)
{
string sql = $@"SELECT e.* FROM rb_employee e
LEFT JOIN rb_okr_objective o on e.EmployeeId = o.CreateBy AND o.`Status` in(1,2)
WHERE e.RB_Group_id ={GroupId} AND e.IsLeave =0 AND o.Id is null";
......
......@@ -51,7 +51,7 @@ namespace Edu.WebApi.Controllers.APP
{
JObject jobj = JObject.Parse(RequestParm.Msg.ToString());
string account = jobj.GetStringValue("account");
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel()
var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{
Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student
......@@ -84,7 +84,7 @@ namespace Edu.WebApi.Controllers.APP
string account = jobj.GetStringValue("Account");
string password = jobj.GetStringValue("Password");
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel()
var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{
Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student
......@@ -180,7 +180,7 @@ namespace Edu.WebApi.Controllers.APP
{
JObject jobj = JObject.Parse(RequestParm.Msg.ToString());
string account = jobj.GetStringValue("account");
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel()
var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{
Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student
......@@ -263,7 +263,7 @@ namespace Edu.WebApi.Controllers.APP
}
}
}
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel()
var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{
Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student
......@@ -343,7 +343,7 @@ namespace Edu.WebApi.Controllers.APP
{
JObject jobj = JObject.Parse(RequestParm.Msg.ToString());
string openid = jobj.GetStringValue("Openid");
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel()
var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{
OpenId = openid.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student
......@@ -438,7 +438,7 @@ namespace Edu.WebApi.Controllers.APP
}
}
}
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel()
var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{
Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment