Commit 271b73e8 authored by 黄奎's avatar 黄奎

页面修改

parent 7dbe8dcf
......@@ -647,6 +647,29 @@ namespace Edu.Module.Customer
return flag;
}
/// <summary>
/// 检查协助类型是否存在
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public bool CheckAssistTypeExistsModule(RB_Student_Assist_Extend query)
{
List<WhereHelper> list = new List<WhereHelper>();
list.Add(new WhereHelper(nameof(RB_Student_Assist_Extend.AssistType), (int)query.AssistType));
list.Add(new WhereHelper(nameof(RB_Student_Assist_Extend.Status), (int)DateStateEnum.Normal));
list.Add(new WhereHelper(nameof(RB_Student_Assist_Extend.StuId), query.StuId));
if (query.Id > 0)
{
list.Add(new WhereHelper()
{
FiledName = nameof(RB_Student_Assist_Extend.Id),
FiledValue = query.Id,
OperatorEnum = OperatorEnum.NotEqual
});
}
return student_AssistRepository.Exists(list);
}
/// <summary>
/// 获取学员协助人员列表
/// </summary>
......
......@@ -185,17 +185,26 @@ namespace Edu.Module.User
}
var destinationList = destinationRepository.GetDestinationListRepository(new Model.ViewModel.System.RB_Destination_ViewModel() { Ids = qIds });
//转介人列表
//同业录入列表
List<RB_Customer_Extend> customerList = new List<RB_Customer_Extend>();
List<int> customerIdList = Common.ConvertHelper.StringToList(string.Join(",", list.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput).Select(qitem => qitem.StuSourceId)));
if (customerIdList != null && customerIdList.Count > 0)
{
customerList= customerRepository.GetCustomerListRepository(new RB_Customer_Extend()
{
CustomerIds = string.Join(",", customerIdList)
});
}
List<RB_Student_ViewModel> transStudentList = new List<RB_Student_ViewModel>();
//转介人列表
List<int> transIdList = Common.ConvertHelper.StringToList(string.Join(",", list.Where(qitem => qitem.CreateType == StuCreateTypeEnum.TransIntroduction).Select(qitem => qitem.StuSourceId)));
if (transIdList != null && transIdList.Count > 0)
{
customerList= customerRepository.GetCustomerListRepository(new RB_Customer_Extend()
transStudentList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel()
{
CustomerIds = string.Join(",", transIdList)
StuIds = string.Join(",", transIdList)
});
}
foreach (var item in list)
{
var tempOrderList = stuOrderList?.Where(qitem => qitem.Student_Id == item.StuId)?.ToList();
......@@ -222,11 +231,14 @@ namespace Edu.Module.User
{
item.StuSourceIdName = accountList?.FirstOrDefault(qitem => qitem.Id == item.StuSourceId)?.AccountName ?? "";
}
else if (item.CreateType == StuCreateTypeEnum.TransIntroduction)
else if (item.CreateType == StuCreateTypeEnum.CustomerInput)
{
item.StuSourceIdName = customerList?.FirstOrDefault(qitem => qitem.CustomerId == item.StuSourceId)?.CustomerName ?? "";
}
else if (item.CreateType == StuCreateTypeEnum.TransIntroduction)
{
item.StuSourceIdName = transStudentList?.FirstOrDefault(qitem => qitem.StuId == item.StuSourceId)?.StuName ?? "";
}
item.StuStageName = stageList?.FirstOrDefault(qitem => qitem.Id == item.StuStage)?.StageName ?? "";
item.StuTypeName = stuTypeList?.FirstOrDefault(qitem => qitem.Id == item.StuType)?.Name ?? "";
}
......
......@@ -70,10 +70,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > -1)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrWhiteSpace(query.StuName))
{
builder.AppendFormat(" AND t.{0} LIKE @StuName ", nameof(RB_Student_ViewModel.StuName));
......
......@@ -36,7 +36,6 @@ namespace Edu.WebApi.Controllers.B2BApp
/// </summary>
private readonly ClassModule classModule = new ClassModule();
/// <summary>
/// 客户返佣和幸福存折处理类对象
......
......@@ -457,6 +457,10 @@ namespace Edu.WebApi.Controllers.Customer
StuId = StuId,
Status = Common.Enum.DateStateEnum.Normal
};
if (customerStudentModule.CheckAssistTypeExistsModule(model))
{
return ApiResult.Failed(message: string.Format("已存在【{0}】类型的协助人员!", model.AssistType.ToName()));
}
bool flag = customerStudentModule.SetStudentAssistModule(StuId, model, base.UserInfo.Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......
......@@ -764,9 +764,24 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult GetStudentList()
{
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Student_ViewModel>(RequestParm.Msg.ToString());
var query = new RB_Student_ViewModel()
{
StuName = base.ParmJObj.GetStringValue("StuName"),
StuTel = base.ParmJObj.GetStringValue("StuTel"),
CreateBy = base.ParmJObj.GetInt("CreateBy"),
IsQueryMyStu = base.ParmJObj.GetInt("IsQueryMyStu"),
CustomerId = base.ParmJObj.GetInt("CustomerId"),
StuStage = base.ParmJObj.GetInt("StuStage"),
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
BelongType = base.ParmJObj.GetInt("BelongType"),
QStudentType = base.ParmJObj.GetInt("QStudentType", -1),
QQ = base.ParmJObj.GetStringValue("QQ"),
WeChatNo = base.ParmJObj.GetStringValue("WeChatNo"),
StuType = base.ParmJObj.GetInt("StuType"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
//query.School_Id = base.UserInfo.School_Id;
var list = studentModule.GetStudentListModule(query);
return ApiResult.Success(data: list);
}
......
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