Commit 67dfedf6 authored by liudong1993's avatar liudong1993

1

parent ffcba34f
......@@ -74,6 +74,19 @@ namespace Edu.WebApi.Controllers.Applet
if (stuModel == null) { return ApiResult.Failed("账号不存在"); }
//获取协助人员
List<object> RAssistList = new List<object>();
//首先获取学员的创建人 (市场经理)
if (stuModel.EnterID > 0)
{
var EnterModel = UserReidsCache.GetUserLoginInfo(stuModel.EnterID);
RAssistList.Add(new
{
AssistId = stuModel.EnterID,
AssistTypeName = "市场经理",
EmployeeName = EnterModel.AccountName,
EnterModel.UserIcon,
Mobile = EnterModel.UserMobile
});
}
var assistList = studentModule.GetStuAssistListModule(accountModel.AccountId);
foreach (var item in assistList) {
var empModel = accountModule.GetEmployeeInfo(item.AssistId);
......
......@@ -116,21 +116,23 @@ namespace Edu.WebApi.Controllers.APP
//判断学员是否退学
var studentList = studentModule.GetStudentInfo(model.AccountId, model.Group_Id);
if (studentList == null || !studentList.Any())
{
return ApiResult.Failed(message: $"很抱歉,由于你已经退学,无法继续使用本系统", new { Error = 3 });
}
RB_Student_ViewModel studentModel = new RB_Student_ViewModel();
studentModel = studentList.Where(x => x.ClassStatus == 2).FirstOrDefault();
if (studentModel == null || studentModel.StuId == 0)
//if (studentList == null || !studentList.Any())
//{
// return ApiResult.Failed(message: $"很抱歉,由于你已经退学,无法继续使用本系统", new { Error = 3 });
//}
if (studentList.Any())
{
studentModel = new RB_Student_ViewModel();
studentModel = studentList.Where(x => x.ClassStatus == 1).FirstOrDefault();
studentModel = studentList.Where(x => x.ClassStatus == 2).FirstOrDefault();
if (studentModel == null || studentModel.StuId == 0)
{
studentModel = new RB_Student_ViewModel();
studentModel = studentList.Where(x => x.ClassStatus == 3).FirstOrDefault();
studentModel = studentList.Where(x => x.ClassStatus == 1).FirstOrDefault();
if (studentModel == null || studentModel.StuId == 0)
{
studentModel = new RB_Student_ViewModel();
studentModel = studentList.Where(x => x.ClassStatus == 3).FirstOrDefault();
}
}
}
......@@ -229,21 +231,62 @@ namespace Edu.WebApi.Controllers.APP
string account = jobj.GetStringValue("Account");
string UnionId = jobj.GetStringValue("UnionId");
string OpenId = jobj.GetStringValue("OpenId");
int IsVisitor = jobj.GetInt("IsVisitor", 0);// 1是游客登录
string WeChatName = jobj.GetStringValue("WeChatName");
string WeChatPhoto = jobj.GetStringValue("WeChatPhoto");
if (string.IsNullOrEmpty(account))
{
return ApiResult.Failed(message: "请授权手机号码!", new { Error = -1 });
return ApiResult.Failed(message: "手机号码登录失败、跳转至账号登录", new { Error = -1 });
}
var model = accountModule.GetStudentExt(new RB_Account_ViewModel()
{
Account = account.Trim(),
AccountType = Common.Enum.User.AccountTypeEnum.Student
})?.FirstOrDefault();
if (model == null)
if (model == null && IsVisitor == 0)
{
return ApiResult.Failed(message: "用户不存在", new { Error = -1 });
return ApiResult.Failed(message: "手机号码登录失败、跳转至账号登录", new { Error = -1 });
}
else
{
if (model == null && IsVisitor == 1) {
int GroupId = 100000;//默认
int CreateBy = 1;//默认管理员
//游客登录 注册游客信息
studentModule.SetStudentModule(new RB_Student_ViewModel()
{
StuId = 0,
StuName = WeChatName,
StuTel = account,
StuIcon = WeChatPhoto,
StuSex = 0,
StuBirth = null,
ProviceId = 0,
CityId = 0,
AreaId = 0,
Group_Id = GroupId,
School_Id = 0,
Status = 0,
CreateBy = CreateBy,
CreateTime = DateTime.Now,
UpdateBy = CreateBy,
UpdateTime = DateTime.Now,
IsDisable = 1,
StuStatus = 0,
CreateType = Common.Enum.User.StuCreateTypeEnum.EmployeeInput,
StuStage = 1,
StuChannel = 0,
PlatformName = "",
StuType = 0,
StuRealMobile = account
});
//再次获取学生信息
model = accountModule.GetStudentExt(new RB_Account_ViewModel() { Account = account.Trim(), AccountType = Common.Enum.User.AccountTypeEnum.Student })?.FirstOrDefault();
}
if (model == null)
{
return ApiResult.Failed(message: "游客注册失败", new { Error = -2 });
}
if (!string.IsNullOrEmpty(model.OpenId))//UnionId是否为空,为空则绑定手机号与UnionId
{
if (OpenId != model.OpenId)
......@@ -264,11 +307,10 @@ namespace Edu.WebApi.Controllers.APP
//判断学员是否退学
var studentList = studentModule.GetStudentInfo(model.AccountId, model.Group_Id);
if (studentList == null || !studentList.Any())
{
return ApiResult.Failed(message: $"很抱歉,由于你已经退学,无法继续使用本系统", new { Error = 3 });
}
//if (studentList == null || !studentList.Any())
//{
// return ApiResult.Failed(message: $"很抱歉,由于你已经退学,无法继续使用本系统", new { Error = 3 });
//}
RB_Student_ViewModel studentModel = new RB_Student_ViewModel();
studentModel = studentList.Where(x => x.ClassStatus == 2).FirstOrDefault();
if (studentModel == null || studentModel.StuId == 0)
......
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