Commit f1863477 authored by 吴春's avatar 吴春

提交app接口

parent 882363ab
...@@ -49,12 +49,18 @@ namespace Edu.Module.User ...@@ -49,12 +49,18 @@ namespace Edu.Module.User
return accountRepository.GetAccountListExtRepository(query); return accountRepository.GetAccountListExtRepository(query);
} }
/// <summary>
/// 添加修改账号 public List<RB_Account_ViewModel> GetStudentExt(RB_Account_ViewModel query)
/// </summary> {
/// <param name="model"></param> return accountRepository.GetStudentExt(query);
/// <returns></returns> }
public bool SetAccountModule(RB_Account_ViewModel model)
/// <summary>
/// 添加修改账号
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetAccountModule(RB_Account_ViewModel model)
{ {
bool flag; bool flag;
if (model.Id > 0) if (model.Id > 0)
......
...@@ -107,7 +107,7 @@ WHERE 1=1 ...@@ -107,7 +107,7 @@ WHERE 1=1
{ {
where2.AppendFormat(" AND p.{0}='{1}' ", nameof(RB_Account_ViewModel.PostName), query.PostName); 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); where.AppendFormat(" AND B.{0}={1} ", nameof(RB_Account_ViewModel.Post_Id), query.Post_Id);
} }
...@@ -157,6 +157,57 @@ WHERE 1=1 {1} ...@@ -157,6 +157,57 @@ WHERE 1=1 {1}
return list; 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>
/// 获取账户总数量 /// 获取账户总数量
/// </summary> /// </summary>
...@@ -495,9 +546,10 @@ WHERE 1=1 ...@@ -495,9 +546,10 @@ WHERE 1=1
{ {
if (!string.IsNullOrWhiteSpace(builderWhere.ToString())) 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); 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 ...@@ -512,7 +564,8 @@ WHERE 1=1
/// </summary> /// </summary>
/// <param name="GroupId"></param> /// <param name="GroupId"></param>
/// <returns></returns> /// <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 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) 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"; WHERE e.RB_Group_id ={GroupId} AND e.IsLeave =0 AND o.Id is null";
......
...@@ -51,7 +51,7 @@ namespace Edu.WebApi.Controllers.APP ...@@ -51,7 +51,7 @@ namespace Edu.WebApi.Controllers.APP
{ {
JObject jobj = JObject.Parse(RequestParm.Msg.ToString()); JObject jobj = JObject.Parse(RequestParm.Msg.ToString());
string account = jobj.GetStringValue("account"); string account = jobj.GetStringValue("account");
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{ {
Account = account.Trim(), Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student AccountType = Common.Enum.User.AccountTypeEnum.Student
...@@ -84,7 +84,7 @@ namespace Edu.WebApi.Controllers.APP ...@@ -84,7 +84,7 @@ namespace Edu.WebApi.Controllers.APP
string account = jobj.GetStringValue("Account"); string account = jobj.GetStringValue("Account");
string password = jobj.GetStringValue("Password"); string password = jobj.GetStringValue("Password");
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{ {
Account = account.Trim(), Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student AccountType = Common.Enum.User.AccountTypeEnum.Student
...@@ -180,7 +180,7 @@ namespace Edu.WebApi.Controllers.APP ...@@ -180,7 +180,7 @@ namespace Edu.WebApi.Controllers.APP
{ {
JObject jobj = JObject.Parse(RequestParm.Msg.ToString()); JObject jobj = JObject.Parse(RequestParm.Msg.ToString());
string account = jobj.GetStringValue("account"); string account = jobj.GetStringValue("account");
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{ {
Account = account.Trim(), Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student AccountType = Common.Enum.User.AccountTypeEnum.Student
...@@ -263,7 +263,7 @@ namespace Edu.WebApi.Controllers.APP ...@@ -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(), Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student AccountType = Common.Enum.User.AccountTypeEnum.Student
...@@ -343,7 +343,7 @@ namespace Edu.WebApi.Controllers.APP ...@@ -343,7 +343,7 @@ namespace Edu.WebApi.Controllers.APP
{ {
JObject jobj = JObject.Parse(RequestParm.Msg.ToString()); JObject jobj = JObject.Parse(RequestParm.Msg.ToString());
string openid = jobj.GetStringValue("Openid"); string openid = jobj.GetStringValue("Openid");
var model = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{ {
OpenId = openid.Trim(), OpenId = openid.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student AccountType = Common.Enum.User.AccountTypeEnum.Student
...@@ -438,7 +438,7 @@ namespace Edu.WebApi.Controllers.APP ...@@ -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(), Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student 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