Commit 9045a879 authored by 黄奎's avatar 黄奎

页面修改

parents 09918b48 b0cc020a
using Edu.Cache.User;
using Edu.Common.Enum;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.ViewModel.Customer;
using Edu.Repository.Customer;
using Edu.Repository.Log;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -29,6 +31,10 @@ namespace Edu.Module.Customer
/// </summary>
private readonly RB_Customer_RemitRepository customer_RemitRepository = new RB_Customer_RemitRepository();
/// <summary>
/// 学生
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 用户信息修改日志仓储层对象
/// </summary>
private readonly RB_User_ChangeLogRepository changeLogRepository = new RB_User_ChangeLogRepository();
......@@ -313,5 +319,29 @@ namespace Edu.Module.Customer
}
return "";
}
/// <summary>
/// 获取同业下所有学生阶段人数统计
/// </summary>
/// <param name="customerId"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public object GetCustomerStuStageStatistics(int customerId, int group_Id)
{
List<object> RList = new List<object>();
var list = studentRepository.GetCustomerStuStageStatistics(customerId, group_Id);
var elist = EnumHelper.EnumToList(typeof(Common.Enum.User.StuStageEnum));
elist = elist.OrderBy(x => x.Id).ToList();
foreach (var item in elist) {
int Num = list.Where(x => x.StuStage == (Common.Enum.User.StuStageEnum)item.Id).FirstOrDefault()?.OrderCount ?? 0;
RList.Add(new
{
StuStage = item.Id,
StuStageName = item.Name,
StuNum = Num
});
}
return RList;
}
}
}
......@@ -344,7 +344,8 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
};
if (oldModel.CreateBy != CreateBy)
{
var empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel() {
var empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
QIds = oldModel.CreateBy + "," + CreateBy
});
logContent = string.Format("复制人:由【{0}】=>【{1}】",
......@@ -356,5 +357,16 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 an
student_LogRepository.AddStuLogRepository(oldModel.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, OperateId);
return flag;
}
/// 获取同业下学生阶段人数统计
/// </summary>
/// <param name="customerId"></param>
/// <param name="group_Id"></param>
/// <returns></returns>
public List<RB_Student_ViewModel> GetCustomerStuStageStatistics(int customerId, int group_Id)
{
string sql = $@"SELECT StuStage,COUNT(0) as OrderCount FROM rb_student WHERE Group_Id ={group_Id} and CustomerId ={customerId} GROUP BY StuStage";
return Get<RB_Student_ViewModel>(sql).ToList();
}
}
}
\ No newline at end of file
......@@ -526,6 +526,24 @@ namespace Edu.WebApi.Controllers.Customer
}
}
/// <summary>
/// 获取同业下所有学生阶段人数统计
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomerStuStageStatistics()
{
var userInfo = base.UserInfo;
int CustomerId = base.ParmJObj.GetInt("CustomerId", 0);//同业ID
if (CustomerId <= 0)
{
return ApiResult.ParamIsNull();
}
var Robj = customerModule.GetCustomerStuStageStatistics(CustomerId, userInfo.Group_Id);
return ApiResult.Success("", Robj);
}
#endregion
}
}
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