Commit ae96b6c1 authored by 黄奎's avatar 黄奎

页面修改

parent e8cc690b
......@@ -39,5 +39,10 @@ namespace Edu.Model.ViewModel.User
/// 更新时间
/// </summary>
public string UpdateTimeStr { get { return Common.ConvertHelper.FormatTime(this.UpdateTime); } }
/// <summary>
/// 审核状态字符串
/// </summary>
public string AuditStatusStr { get { return Common.Plugin.EnumHelper.GetEnumName(this.AuditStatus); } }
}
}
\ No newline at end of file
......@@ -39,5 +39,10 @@ namespace Edu.Model.ViewModel.User
/// 修改时间
/// </summary>
public string UpdateTimeStr { get { return Common.ConvertHelper.FormatTime(this.UpdateTime); } }
/// <summary>
/// 审核状态字符串
/// </summary>
public string AuditStatusStr { get { return Common.Plugin.EnumHelper.GetEnumName(this.AuditStatus); } }
}
}
\ No newline at end of file
using Edu.Common.Enum;
using Edu.AOP.CustomerAttribute;
using Edu.Common.Enum;
using Edu.Common.Enum.User;
using Edu.Model.CacheModel;
using Edu.Model.Entity.User;
using Edu.Model.ViewModel.User;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
using System.Linq;
using VT.FW.DB;
......@@ -18,6 +22,11 @@ namespace Edu.Module.User
/// </summary>
private readonly RB_AssistRepository assistRepository = new RB_AssistRepository();
/// <summary>
/// 账号处理类
/// </summary>
private readonly AccountModule accountModule = new AccountModule();
/// <summary>
/// 获取助教列表
/// </summary>
......@@ -100,5 +109,47 @@ namespace Edu.Module.User
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), AId));
return flag;
}
/// <summary>
/// 讲师审核
/// </summary>
/// <param name="AId">助教编号</param>
/// <param name="AuditStatus">审核状态</param>
/// <param name="AuditRemark">审核备注</param>
/// <param name="user">用户信息</param>
/// <returns></returns>
[TransactionCallHandler]
public virtual bool AuditAssistModule(int AId, int AuditStatus, string AuditRemark, UserInfo user)
{
bool flag = false;
var model = GetAssistModule(AId);
if (model != null)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Assist_ViewModel.AuditStatus),AuditStatus },
{nameof(RB_Assist_ViewModel.Remark),AuditRemark },
};
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist_ViewModel.AId), AId));
AccountStatusEnum statusEnum = (AccountStatusEnum)AuditStatus;
if (statusEnum == AccountStatusEnum.Pass && flag)
{
flag = accountModule.SetAccountModule(new RB_Account_ViewModel()
{
Account = model.AssistTel,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd),
AccountType = AccountTypeEnum.Assist,
AccountId = model.AId,
CreateBy = user.Id,
UpdateBy = user.Id,
CreateTime = DateTime.Now,
UpdateTime = DateTime.Now,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
});
}
}
return flag;
}
}
}
......@@ -376,7 +376,6 @@ namespace Edu.WebApi.Controllers.User
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
//extModel.School_Id = base.UserInfo.School_Id;
extModel.AuditStatus = Common.Enum.User.AccountStatusEnum.Normal;
bool flag = assistModule.SetAssistModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
......@@ -405,6 +404,20 @@ namespace Edu.WebApi.Controllers.User
var flag = assistModule.RemoveAssistModule(AId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 助教审核
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult AuditAssist()
{
var AId = base.ParmJObj.GetInt("AId", 0);
int AuditStatus = base.ParmJObj.GetInt("AuditStatus", 1);
string AuditRemark = base.ParmJObj.GetStringValue("AuditRemark");
var flag = assistModule.AuditAssistModule(AId, AuditStatus, AuditRemark, base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 学生管理
......
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