Commit 12b48e44 authored by 黄奎's avatar 黄奎

页面修改

parent 4934137f
......@@ -142,6 +142,11 @@ namespace Edu.Model.Entity.User
/// </summary>
public OrderSourceEnum StuSource { get; set; }
/// <summary>
/// 来源人编号
/// </summary>
public int StuSourceId { get; set; }
/// <summary>
/// 学员地址
/// </summary>
......@@ -168,9 +173,9 @@ namespace Edu.Model.Entity.User
public string StuIDCardAddress { get; set; }
/// <summary>
/// 录入方式(1-员工录入,2-同业录入)
/// 客户来源见枚举
/// </summary>
public int CreateType { get; set; }
public StuCreateTypeEnum CreateType { get; set; }
/// <summary>
/// 客户阶段(见枚举)
......
......@@ -209,5 +209,10 @@ namespace Edu.Model.ViewModel.User
/// 同行
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 来源人名称
/// </summary>
public string StuSourceIdName { get; set; }
}
}
\ No newline at end of file
using Edu.Common.Enum;
using Edu.Common.Enum.Duty;
using Edu.Common.Enum.System;
using Edu.Common.Enum.User;
using Edu.Common.Message;
using Edu.Model.CacheModel;
using Edu.Model.ViewModel.Duty;
using Edu.Model.ViewModel.Reserve;
using Edu.Model.ViewModel.User;
using Edu.Repository.Duty;
using Edu.Repository.Reserve;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
......@@ -56,6 +59,16 @@ namespace Edu.Module.Duty
/// </summary>
private readonly RB_Duty_FrequencyRepository duty_FrequencyRepository = new RB_Duty_FrequencyRepository();
/// <summary>
/// 试听课仓储层对象
/// </summary>
private readonly RB_Visitor_ReserveRepository visitor_ReserveRepository = new RB_Visitor_ReserveRepository();
/// <summary>
/// 学员仓储层对象
/// </summary>
public readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 获取值班计划分页列表【管理端】
/// </summary>
......@@ -1644,5 +1657,61 @@ namespace Edu.Module.Duty
}
}
}
/// <summary>
/// 访客转学员
/// </summary>
public void TransVisitorToStu()
{
var list = visitorRepository.GetVisitorPageRepository(1, 1000, out _, new RB_Visitor_ViewModel()
{
Group_Id= 100000
});
var classList = visitor_ReserveRepository.GetVisitorReserveListRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
{
});
foreach (var item in list)
{
var extModel = new RB_Student_ViewModel()
{
StuId = 0,
StuName = item.Name,
StuTel = item.Tel,
StuIcon ="",
StuSex = 0,
StuChannel = StuChannelEnum.PassBy
};
if (extModel.StuId == 0)
{
extModel.CreateType = StuCreateTypeEnum.EmployeeInput;
}
extModel.Status = DateStateEnum.Normal;
extModel.StuStatus = 1;
extModel.CreateTime = DateTime.Now;
extModel.UpdateTime = DateTime.Now;
extModel.CreateBy = item.CreateBy;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = item.CreateBy;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = item.Group_Id;
extModel.CustomerId = 0;
extModel.IsDisable = 1;
bool flag = studentRepository.SetStudentRepository(extModel);
//更新试听班级学员关联
var tempList = classList.Where(qitem => qitem.Visitor_Id == item.Id)?.ToList();
foreach (var cItem in tempList)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Visitor_Reserve_Extend.Visitor_Id),extModel.StuId }
};
visitor_ReserveRepository.Update(fileds, new WhereHelper(nameof(RB_Visitor_Reserve_Extend.Id), cItem.Id));
}
}
}
}
}
......@@ -99,14 +99,17 @@ namespace Edu.Module.User
if (list != null && list.Count > 0)
{
string stuIds = string.Join(",", list.Select(qitem => qitem.StuId));
//学员跟进
var followList= followRepository.GetStudentFollowListRepository(new Model.ViewModel.Customer.RB_Student_Follow_Extend()
{
QStuIds = stuIds
});
//学员订单
var stuOrderList = student_OrderGuestRepository.GetStrOrderGuestListRepository(new RB_Student_OrderGuest_ViewModel()
{
QStudentIds = stuIds
});
//本周新增
var stuList= studentRepository.GetCustomerStuWeekListRepository(new RB_Student_ViewModel()
{
CustomerId = query.CustomerId
......@@ -116,11 +119,16 @@ namespace Edu.Module.User
{
QStuIds = stuIds
});
string aIds = string.Join(",", assistList.Select(qitem => qitem.AssistId));
List<int> empIdList= Common.ConvertHelper.StringToList(string.Join(",", list.Select(qitem => qitem.StuSourceId)));
List<int> aIds = Common.ConvertHelper.StringToList(string.Join(",", assistList.Select(qitem => qitem.AssistId)));
List<RB_Account_ViewModel> accountList = new List<RB_Account_ViewModel>();
if (!string.IsNullOrEmpty(aIds))
if (aIds!=null&&aIds.Count>0)
{
accountList= accountModule.GetAccountListExtModule(new RB_Account_ViewModel() { QIds = aIds });
empIdList.AddRange(aIds);
}
if (empIdList != null && empIdList.Count > 0)
{
accountList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() { QIds = string.Join(",", empIdList) });
}
//学员到访统计
var visitList = student_VisitRepository.GetStudentVisitStaticRepository(new RB_Student_Visit_Extend()
......@@ -180,6 +188,7 @@ namespace Edu.Module.User
item.AssistList = tempAssistList;
item.VisitCount = visitList?.FirstOrDefault(qitem => qitem.StuId == item.StuId)?.VisitCount ?? 0;
item.TrialLessonCount = stuReserveList?.FirstOrDefault(qitem => qitem.Visitor_Id == item.StuId)?.TrialLessonCount ?? 0;
item.StuSourceIdName = accountList?.FirstOrDefault(qitem => qitem.Id == item.StuSourceId)?.AccountName ?? "";
}
}
return list;
......
using Edu.Model.Entity.Customer;
using Edu.Common.Enum;
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
......@@ -25,6 +26,7 @@ SELECT A.*
FROM RB_Student_Assist AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Assist_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.StuId > 0)
......
......@@ -180,6 +180,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}<='{1} 23:59:59' ", nameof(RB_Student_ViewModel.CreateTime), query.EndTime);
}
if (!string.IsNullOrEmpty(query.QDate))
{
builder.AppendFormat(" AND DATE_FORMAT(t.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Student_ViewModel.CreateTime), query.QDate);
}
}
builder.AppendFormat(" ORDER BY t.{0} DESC ", nameof(RB_Student_ViewModel.StuId));
return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......@@ -323,6 +327,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
{nameof(RB_Student_ViewModel.StuStage),model.StuStage },
{nameof(RB_Student_ViewModel.StuChannel),model.StuChannel },
{nameof(RB_Student_ViewModel.PlatformName),model.PlatformName },
{nameof(RB_Student_ViewModel.StuSourceId),model.StuSourceId}
};
flag = base.Update(fileds, new WhereHelper(nameof(RB_Student_ViewModel.StuId), model.StuId));
createBy = model.UpdateBy;
......@@ -350,7 +355,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
UpdateTime = DateTime.Now,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd)
});
if (model.CreateType == 1)
if (model.CreateType == Common.Enum.User.StuCreateTypeEnum.EmployeeInput)
{
createBy = model.CreateBy;
}
......@@ -361,7 +366,7 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
logContent = "创建了该客户";
logTitle = "创建客户";
}
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, createBy, CreateType: model.CreateType);
student_LogRepository.AddStuLogRepository(model.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, createBy, CreateType: (int)model.CreateType);
return flag;
}
......
......@@ -452,7 +452,7 @@ namespace Edu.WebApi.Controllers.Customer
{
int Id = base.ParmJObj.GetInt("Id");
bool flag = customerStudentModule.RemoveStudentAssistModule(Id, base.UserInfo.Id);
return ApiResult.Failed();
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
......
......@@ -35,11 +35,6 @@ namespace Edu.WebApi.Controllers.Duty
/// </summary>
private readonly DutyPlanModule dutyPlanModule = AOP.AOPHelper.CreateAOPObject<DutyPlanModule>();
/// <summary>
/// 学员处理类对象
/// </summary>
private readonly StudentModule studentModule = AOP.AOPHelper.CreateAOPObject<StudentModule>();
/// <summary>
/// 客户学员处理类对象
/// </summary>
......@@ -761,67 +756,5 @@ namespace Edu.WebApi.Controllers.Duty
var data = classModule.GetDateTrialLessonModule(planDate, planDate);
return ApiResult.Success(data: data);
}
/// <summary>
/// 获取学生分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult DutyGetStudentPageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_ViewModel()
{
KeyWords = base.ParmJObj.GetStringValue("KeyWords")
};
if (query.IsQueryMyStu == 1)
{
query.CreateBy = base.UserInfo.Id;
}
query.Group_Id = base.UserInfo.Group_Id;
var data = studentModule.GetStudentPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
foreach (var item in data)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
list.Add(new
{
item.StuId,
item.StuName,
item.StuTel,
item.StuIcon,
item.StuSex,
StuSexStr = item.StuSex == 0 ? "男" : "女",
StuBirth = Common.ConvertHelper.FormatDate(item.StuBirth),
item.StuStage,
StuStageName = item.StuStage.ToName(),
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.CreateByName,
item.CreateType,
CreateTypeStr = item.CreateType == 1 ? "员工录入" : "同业录入",
item.StuChannel,
StuChannelName = item.StuChannel.ToName(),
item.PlatformName,
item.CustomerId,
AssistList = item.AssistList.Select(qitem => new
{
qitem.Id,
qitem.StuId,
qitem.AssistId,
qitem.AssistName,
qitem.AssistType,
AssistTypeName = qitem.AssistType.ToName()
}),
});
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
}
}
......@@ -10,6 +10,7 @@ using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.ViewModel.System;
using Edu.Model.ViewModel.User;
using Edu.Module.Duty;
using Edu.Module.Public;
using Edu.Module.System;
using Edu.Module.User;
......@@ -53,21 +54,7 @@ namespace Edu.WebApi.Controllers.User
[AllowAnonymous]
public ApiResult Test()
{
//Common.Message.MessageHelper.SendMessage(new Common.Message.PushMessageModel()
//{
// CategoryId = 0,
// Content = "1111",
// CoverImg = "",
// CreateByName = "HK",
// JumpUrl = "",
// MsgSign = "1",
// MsgTemplateCode = "",
// Platform = 2,
// ReceiveId = "1",
// SendTime = DateTime.Now,
// SendType = 0,
// Title = "HKHK"
//});
new DutyPlanModule().TransVisitorToStu();
return ApiResult.Success();
}
......
......@@ -13,6 +13,7 @@ using Edu.Model.ViewModel.Customer;
using Edu.Model.ViewModel.Log;
using Edu.Model.ViewModel.User;
using Edu.Module.Course;
using Edu.Module.Duty;
using Edu.Module.Log;
using Edu.Module.User;
using Edu.WebApi.Filter;
......@@ -97,6 +98,11 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
private readonly ClassModule classModule = new ClassModule();
/// <summary>
/// 值班计划处理类对象
/// </summary>
private readonly DutyPlanModule dutyPlanModule = AOP.AOPHelper.CreateAOPObject<DutyPlanModule>();
#region 用户账户管理
/// <summary>
......@@ -663,12 +669,21 @@ namespace Edu.WebApi.Controllers.User
StuStage = (StuStageEnum)base.ParmJObj.GetInt("StuStage"),
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
};
if (query.IsQueryMyStu == 1)
{
query.CreateBy = base.UserInfo.Id;
}
int PlanId = base.ParmJObj.GetInt("PlanId");
if (PlanId > 0)
{
var planModel = dutyPlanModule.GetDutyPlanModule(PlanId);
string planDate = Common.ConvertHelper.FormatDate(planModel.Date);
if (!string.IsNullOrEmpty(planDate))
{
query.QDate = planDate;
}
}
query.Group_Id = base.UserInfo.Group_Id;
var data = studentModule.GetStudentPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
......@@ -693,7 +708,7 @@ namespace Edu.WebApi.Controllers.User
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.CreateByName,
item.CreateType,
CreateTypeStr = item.CreateType == 1 ? "员工录入" : "同业录入",
CreateTypeStr = item.CreateType.ToName(),
item.StuChannel,
StuChannelName= item.StuChannel.ToName(),
item.PlatformName,
......@@ -708,6 +723,17 @@ namespace Edu.WebApi.Controllers.User
qitem.AssistType,
AssistTypeName = qitem.AssistType.ToName()
}),
item.JapanBaseInfo,
JapanBaseInfoName=item.JapanBaseInfo.ToName(),
item.StuProfession,
item.StuEducation,
StuEducationName= item.StuEducation.ToName(),
item.StuPurpose,
StuPurposeName=item.StuPurpose.ToName(),
item.VisitCount,
item.TrialLessonCount,
item.StuSourceId,
item.StuSourceIdName,
});
}
pageModel.Count = rowsCount;
......@@ -761,10 +787,11 @@ namespace Edu.WebApi.Controllers.User
StuStage = (StuStageEnum)base.ParmJObj.GetInt("StuStage"),
StuChannel = (StuChannelEnum)base.ParmJObj.GetInt("StuChannel"),
PlatformName = base.ParmJObj.GetStringValue("PlatformName"),
StuSourceId=base.ParmJObj.GetInt("StuSourceId"),
};
if (extModel.StuId == 0)
{
extModel.CreateType = 1;
extModel.CreateType = StuCreateTypeEnum.EmployeeInput;
}
if (string.IsNullOrEmpty(extModel.StuTel))
{
......@@ -869,7 +896,7 @@ namespace Edu.WebApi.Controllers.User
StuIDCardAddress = base.ParmJObj.GetStringValue("StuIDCardAddress"),
StuStage = (StuStageEnum)base.ParmJObj.GetInt("StuStage"),
};
extModel.CreateType = 2;
extModel.CreateType = StuCreateTypeEnum.CustomerInput;
if (extModel.StuId == 0)
{
extModel.StuStage = StuStageEnum.NewStu;
......@@ -993,7 +1020,7 @@ namespace Edu.WebApi.Controllers.User
newClassStatus,
classStatusName,
extModel.CreateType,
CreateTypeStr = extModel.CreateType == 1 ? "员工录入" : "同业录入",
CreateTypeStr = extModel.CreateType.ToName(),
extModel.StuStage,
StuStageName = extModel.StuStage.ToName(),
extModel.CreateBy,
......@@ -1001,6 +1028,7 @@ namespace Edu.WebApi.Controllers.User
StuChannelName = extModel.StuChannel.ToName(),
extModel.PlatformName,
AssistList = extModel?.AssistList ?? new List<RB_Student_Assist_Extend>(),
extModel.StuSourceId,
};
return ApiResult.Success(data: obj);
}
......
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