Commit 3d4d0538 authored by 吴春's avatar 吴春

提交代码

parent 8314e080
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Course
{
public enum GuestClassHoursEarlyWarningEnum
{
/// <summary>
/// 无
/// </summary>
[EnumField("无")]
All = 0,
/// <summary>
/// 不足5课时
/// </summary>
[EnumField("不足5课时")]
NotFive = 1,
/// <summary>
/// 不足10课时
/// </summary>
[EnumField("不足10课时")]
NotTen = 2,
/// <summary>
/// 不足15课时
/// </summary>
[EnumField("不足15课时")]
NotFifteen = 3,
/// <summary>
/// 不足20课时
/// </summary>
[EnumField("不足20课时")]
NotTwenty = 4,
}
}
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.User
{
/// <summary>
/// 学员事件记录实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Student_EventLog
{
/// <summary>
/// 主键事件编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// (学生编号)
/// </summary>
public int StuId { get; set; }
/// <summary>
/// 标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 类型(1-处分,2-奖励)
/// </summary>
public int EventType { get; set; }
/// <summary>
/// 内容
/// </summary>
public string EventContent { get; set; }
/// <summary>
/// 图片
/// </summary>
public string EventPic { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Course;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 学员名单扩展表
/// </summary>
public class RB_Order_Guest_Extend : RB_Order_Guest
{
/// <summary>
/// 合同编号
/// </summary>
public string ContractNo { get; set; }
/// <summary>
/// 合同id
/// </summary>
public int ContractId { get; set; }
/// <summary>
/// 课程id
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public string CourseName { get; set; }
/// <summary>
/// 班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 班号
/// </summary>
public string ClassNo { get; set; }
/// <summary>
/// 老师id
/// </summary>
public int Teacher_Id { get; set; }
/// <summary>
/// 老师名称
/// </summary>
public int TeacherName { get; set; }
/// <summary>
///下单时间
/// </summary>
public DateTime? OrderTime { get; set; }
/// <summary>
///结束下单时间
/// </summary>
public DateTime? EndOrderTime { get; set; }
/// <summary>
/// 业务员
/// </summary>
public int EnterID { get; set; }
/// <summary>
/// 业务员
/// </summary>
public string EnterName { get; set; }
/// <summary>
/// 应收金额
/// </summary>
public decimal PreferPrice { get; set; }
/// <summary>
/// 实收金额
/// </summary>
public decimal Income { get; set; }
/// <summary>
/// 退款金额
/// </summary>
public decimal Refund { get; set; }
/// <summary>
/// 平台税金
/// </summary>
public decimal PlatformTax { get; set; }
/// <summary>
/// 剩余课时
/// </summary>
public int SurplusHours { get; set; }
/// <summary>
/// 缺勤次数
/// </summary>
public int AbsenceNum { get; set; }
/// <summary>
/// 请假次数
/// </summary>
public int LeaveNum { get; set; }
/// <summary>
/// 事件数
/// </summary>
public int EventlogNum { get; set; }
/// <summary>
/// 是否生效 (查询对应:(0-全部 1-未生效,2-正常,3-休学,4-完课)) (生效状态(0-未生效,1-生效中,2-完成))
/// </summary>
public int EffectStatus { get; set; }
/// <summary>
/// 订单报入类型(查询的时候0-全部1-正常报入,2-插班报入,3-续费订单,4-转班订单,5-分拆订单)
/// </summary>
public int JoinType { get; set; }
/// <summary>
/// 学生id(rb_student 表中的id)
/// </summary>
public int Student_Id { get; set; }
/// <summary>
/// 预警类型(0-全部,1-不足5课时,)
/// </summary>
public Common.Enum.Course.GuestClassHoursEarlyWarningEnum EarlyWarning { get; set; }
/// <summary>
/// 学员状态
/// </summary>
public string GuestStateStr
{
get
{
string str = "";
switch (this.GuestState)
{
case 1: str = "正常"; break;
case 2: str = "退学"; break;
case 3: str = "申请退学中"; break;
case 4: str = "驳回申请"; break;
case 5: str = "停课"; break;
case 6: str = "停课申请中"; break;
case 7: str = "完结"; break;
case 8: str = "转班申请中"; break;
}
return str;
}
}
/// <summary>
/// 学员状态
/// </summary>
public string JoinTypeStr
{
get
{
string str = "";
switch (this.JoinType)
{
case 1: str = "正常报入"; break;
case 2: str = "插班报入"; break;
case 3: str = "续费订单"; break;
case 4: str = "转班订单"; break;
case 5: str = "分拆订单"; break;
}
return str;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.User;
namespace Edu.Model.ViewModel.User
{
/// <summary>
/// 学员事件记录扩展实体
/// </summary>
public class RB_Student_EventLog_ViewModel : RB_Student_EventLog
{
/// <summary>
/// 事件图片
/// </summary>
public List<string> EventPicList { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 更新人
/// </summary>
public string UpdateByName { get; set; }
}
}
......@@ -154,6 +154,12 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_User_ChangeLogRepository user_ChangeLogRepository = new RB_User_ChangeLogRepository();
/// <summary>
/// 学员事件记录仓储层
/// </summary>
private readonly RB_Student_EventLogRepository student_EventLogRepository = new RB_Student_EventLogRepository();
/// <summary>
/// 获取班级列表
/// </summary>
......@@ -3332,6 +3338,78 @@ namespace Edu.Module.Course
/// <summary>
/// 获取学员事件记录分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_EventLog_ViewModel> GetStudentEventLogPageList(int pageIndex, int pageSize, out long rowsCount, RB_Student_EventLog_ViewModel query)
{
return student_EventLogRepository.GetStudentEventLogPageList(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
///删除学员事件
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool DelStudentEventLog(int Id, int UpdateBy)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Student_EventLog_ViewModel.Status),1},
{ nameof(RB_Student_EventLog_ViewModel.UpdateBy),UpdateBy},
{ nameof(RB_Student_EventLog_ViewModel.UpdateTime),System.DateTime.Now},
};
return student_EventLogRepository.Update(fileds, new WhereHelper(nameof(RB_Student_EventLog_ViewModel.Id), Id));
}
/// <summary>
/// 新增/修改学员事件
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudentEventLog(RB_Student_EventLog_ViewModel model)
{
bool flag = false;
if (model.Id == 0)
{
flag = student_EventLogRepository.Insert(model) > 0;
}
else
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Student_EventLog_ViewModel.EventContent),model.EventContent},
{ nameof(RB_Student_EventLog_ViewModel.EventType),model.EventType},
{ nameof(RB_Student_EventLog_ViewModel.Title),model.Title},
{ nameof(RB_Student_EventLog_ViewModel.EventPic),model.EventPic},
};
flag = student_EventLogRepository.Update(fileds, new WhereHelper(nameof(RB_Student_EventLog_ViewModel.Id), model.Id));
}
return flag;
}
/// <summary>
/// 获取学员事件记录列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_EventLog_ViewModel> GetStudentEventLogList(RB_Student_EventLog_ViewModel query)
{
return student_EventLogRepository.GetStudentEventLogList(query);
}
#endregion
......@@ -3372,5 +3450,6 @@ namespace Edu.Module.Course
}
#endregion
}
}
}
......@@ -317,5 +317,25 @@ namespace Edu.Module.Course
}
#endregion
#region 学员名单
/// <summary>
/// 获取学员名单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Order_Guest_Extend> GetAllStudentPage(int pageIndex, int pageSize, out long rowsCount, RB_Order_Guest_Extend demodel)
{
var orderstudentList = order_GuestRepository.GetAllStudentPage(pageIndex, pageSize, out rowsCount, demodel);
return orderstudentList;
}
#endregion
}
}
......@@ -372,7 +372,7 @@ namespace Edu.Module.User
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Notice.NoticeState),(int)demodel.NoticeState},
{ nameof(RB_Notice.UpdateBy),demodel.UpdateBy},
// { nameof(RB_Notice.UpdateBy),demodel.UpdateBy},
{ nameof(RB_Notice.UpdateTime),DateTime.Now},
};
List<WhereHelper> wheres = new List<WhereHelper>()
......
......@@ -629,7 +629,120 @@ INNER JOIN rb_temporary_invitation as ti on ti.OrderGuestId=a.Id
WHERE {where}";
return Get<RB_Order_Guest_ViewModel>(sql).ToList();
}
#endregion
#endregion
#region 学员名单
/// <summary>
/// 获取学员名单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Order_Guest_Extend> GetAllStudentPage(int pageIndex, int pageSize, out long rowsCount, RB_Order_Guest_Extend demodel)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT a.*,contract.ContractNo,contract.Id as ContractId,b.CourseId,IFNULL(C.CourseName,'') AS CourseName
,class.ClassName,class.ClassNo,class.Teacher_Id,teacher.TeacherName,b.OrderId,b.CreateTime as OrderTime,b.EnterID,b.PreferPrice,b.Income,b.Refund,b.PlatformTax,
(a.TotalHours-a.CompleteHours) as SurplusHours,gc.AbsenceNum,gc.LeaveNum,eventlog.EventlogNum,b.EffectStatus,b.JoinType,sog.Student_Id
FROM RB_Order_Guest AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId
LEFT JOIN rb_education_contract as contract on contract.GuestId=a.Id and contract.`Status`=0
LEFT JOIN rb_student_orderguest as sog on sog.GuestId=a.Id and sog.`Status`=0
LEFT JOIN rb_class as class on class.ClassId=b.ClassId
LEFT JOIN rb_course AS C ON (B.CourseId=C.CourseId AND B.CourseId>0 AND B.OrderType=1)
LEFT JOIN rb_teacher as teacher on teacher.TId=class.Teacher_Id
LEFT JOIN (SELECT OrderGuestId,
SUM(CASE CheckStatus WHEN 1 THEN 1 ELSE 0 END) as AbsenceNum,
SUM(CASE CheckStatus WHEN 2 THEN 1 ELSE 0 END) as LeaveNum
from rb_class_check where `Status`=0 and CheckStatus <>0 GROUP BY OrderGuestId) as gc on gc.OrderGuestId=a.Id
LEFT JOIN (SELECT StuId,COUNT(*) as EventlogNum from rb_student_eventlog where `Status`=0 GROUP BY StuId) as eventlog on eventlog.StuId=sog.Student_Id
WHERE 1=1 and A.Status=0 and class.Status=0 and class.ClassStatus <>4 and b.OrderState<>3
");
if (demodel.Group_Id > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.Group_Id)} ={demodel.Group_Id}");
}
if (demodel.School_Id > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.School_Id)} ={demodel.School_Id}");
}
if (demodel.CourseId > 0)
{
builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_Extend.CourseId)} ={demodel.CourseId}");
}
if (demodel.ClassId > 0)
{
builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_Extend.ClassId)} ={demodel.ClassId}");
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.GuestName)} like '%{demodel.GuestName}%'");
}
if (!string.IsNullOrEmpty(demodel.ClassNo))
{
builder.AppendFormat($@" AND class.{nameof(RB_Order_Guest_Extend.ClassNo)} like '%{demodel.ClassNo}%'");
}
if (demodel.OrderId > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.OrderId)} ={demodel.OrderId}");
}
if (demodel.EnterID > 0)
{
builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_Extend.EnterID)} ={demodel.EnterID}");
}
if (demodel.OrderTime.HasValue)
{
builder.AppendFormat($@" AND DATE_FORMAT(B.CreateTime,'%y-%m-%d')>=DATE_FORMAT('{demodel.OrderTime.Value.ToString("yyyy-MM-dd")}','%y-%m-%d')");
}
if (demodel.EndOrderTime.HasValue)
{
builder.AppendFormat($@" AND DATE_FORMAT(B.CreateTime,'%y-%m-%d')<=DATE_FORMAT('{demodel.EndOrderTime.Value.ToString("yyyy-MM-dd")}','%y-%m-%d')");
}
if (demodel.EffectStatus > 0)
{
if (demodel.EffectStatus == 1)
{
builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_Extend.EffectStatus)} =0");
}
else
{
builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_Extend.EffectStatus)} >0");
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.GuestState)} ={demodel.GuestState}");
}
}
if (demodel.JoinType > 0)
{
builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_Extend.JoinType)} ={demodel.JoinType}");
}
if (demodel.EarlyWarning == Common.Enum.Course.GuestClassHoursEarlyWarningEnum.NotFifteen)
{
builder.AppendFormat($@" AND (a.TotalHours-a.CompleteHours) <15 ");
}
else if (demodel.EarlyWarning == Common.Enum.Course.GuestClassHoursEarlyWarningEnum.NotFive)
{
builder.AppendFormat($@" AND (a.TotalHours-a.CompleteHours) <5 ");
}
else if (demodel.EarlyWarning == Common.Enum.Course.GuestClassHoursEarlyWarningEnum.NotTen)
{
builder.AppendFormat($@" AND (a.TotalHours-a.CompleteHours) <10 ");
}
else if (demodel.EarlyWarning == Common.Enum.Course.GuestClassHoursEarlyWarningEnum.NotTwenty)
{
builder.AppendFormat($@" AND (a.TotalHours-a.CompleteHours) <20 ");
}
builder.AppendFormat($@" order by A.{nameof(RB_Order_Guest_ViewModel.Id)} desc");
return GetPage<RB_Order_Guest_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Common.Enum;
using Edu.Model.Entity.User;
using Edu.Model.ViewModel.User;
using VT.FW.DB.Dapper;
namespace Edu.Repository.User
{
/// <summary>
/// 学员事件记录仓储层
/// </summary>
public class RB_Student_EventLogRepository : BaseRepository<RB_Student_EventLog>
{
/// <summary>
/// 获取学员事件记录分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_EventLog_ViewModel> GetStudentEventLogPageList(int pageIndex, int pageSize, out long rowsCount, RB_Student_EventLog_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT t.* FROM RB_Student_EventLog AS t WHERE 1=1 ");
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.School_Id), query.School_Id);
}
if (query.StuId > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.StuId), query.StuId);
}
if (query.EventType > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.EventType), query.EventType);
}
}
return GetPage<RB_Student_EventLog_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取学员事件记录列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_EventLog_ViewModel> GetStudentEventLogList(RB_Student_EventLog_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT t.* FROM RB_Student_EventLog AS t WHERE 1=1 ");
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.School_Id), query.School_Id);
}
if (query.StuId > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.StuId), query.StuId);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.Id), query.Id);
}
if (query.EventType > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.EventType), query.EventType);
}
}
return Get<RB_Student_EventLog_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
......@@ -27,7 +27,7 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
private readonly StudentBillModule studentBillModule = AOP.AOPHelper.CreateAOPObject<StudentBillModule>();
private readonly OrderModule orderModule= AOP.AOPHelper.CreateAOPObject<OrderModule>();
private readonly OrderModule orderModule = AOP.AOPHelper.CreateAOPObject<OrderModule>();
/// <summary>
/// 获取学员退课单据分页列表
......@@ -54,14 +54,14 @@ namespace Edu.WebApi.Controllers.Course
//审核备注
string Description = base.ParmJObj.GetStringValue("Description");
//退课金额
decimal BackMoney= base.ParmJObj.GetDecimal("BackMoney");
decimal BackMoney = base.ParmJObj.GetDecimal("BackMoney");
//是否是特殊节点
var SpecialNode = base.ParmJObj.GetInt("SpecialNode");
//抄送人
string RecipientIds = base.ParmJObj.GetStringValue("RecipientIds");
// var flag = studentBillModule.SetBackBillAduitModule(BackId, AuditStatus, Description, base.UserInfo, out string message, SpecialNode: SpecialNode, BackMoney: BackMoney, RecipientIds: RecipientIds);
// var flag = studentBillModule.SetBackBillAduitModule(BackId, AuditStatus, Description, base.UserInfo, out string message, SpecialNode: SpecialNode, BackMoney: BackMoney, RecipientIds: RecipientIds);
//return flag ? ApiResult.Success(message: message) : ApiResult.Failed(message: message);
return ApiResult.Failed();
......@@ -96,11 +96,11 @@ namespace Edu.WebApi.Controllers.Course
int ClientId = parms.GetInt("ClientId", 0);
if (BackClassId <= 0)
{
return ApiResult.ParamIsNull(message:"请传递退课编号!");
return ApiResult.ParamIsNull(message: "请传递退课编号!");
}
if (ClientId <= 0)
{
return ApiResult.ParamIsNull(message:"请传递客户编号!");
return ApiResult.ParamIsNull(message: "请传递客户编号!");
}
string msg = studentBillModule.SetStudentBackFinance(BackClassId, IsPublic, CurrencyId, ClientType, ClientId, userInfo);
return string.IsNullOrEmpty(msg) ? ApiResult.Success() : ApiResult.Failed(msg);
......@@ -120,31 +120,31 @@ namespace Edu.WebApi.Controllers.Course
var oldOrderModel = orderModule.GetClassOrderInfoModule(OrderId);
var orderModel = new RB_Order_ViewModel()
{
OrderId=0,
OrderId = 0,
ClassId = base.ParmJObj.GetInt("ClassId"),//班级编号
GuestNum = 1,
OrderSource= oldOrderModel.OrderSource,
OrderType=oldOrderModel.OrderType,
OrderSource = oldOrderModel.OrderSource,
OrderType = oldOrderModel.OrderType,
Class_Price = base.ParmJObj.GetDecimal("Class_Price"),//单价
Unit_Price = base.ParmJObj.GetDecimal("Class_Price"),//成交单价
PreferPrice = base.ParmJObj.GetDecimal("PreferPrice"),//应收,
Income = 0,
HelpEnterId=oldOrderModel.HelpEnterId,
GeneralOccupation="",
EduOccupation="",
SaleRemark =base.ParmJObj.GetStringValue("SaleRemark"),//销售备注
SourceId=0,
IsLessPrice=0,
LessPrice=0,
OrderNature=oldOrderModel.OrderNature,
HelpEnterId = oldOrderModel.HelpEnterId,
GeneralOccupation = "",
EduOccupation = "",
SaleRemark = base.ParmJObj.GetStringValue("SaleRemark"),//销售备注
SourceId = 0,
IsLessPrice = 0,
LessPrice = 0,
OrderNature = oldOrderModel.OrderNature,
OldPreferPrice = base.ParmJObj.GetDecimal("PreferPrice"),//应收,
CourseId=0,
StartClassHours=0,
UpOrderId=0,
VisitorReserveId=0,
IsRenewOrder=1,
JoinType= Common.Enum.Sale.OrderJoinTypeEnum.RenewOrder,
TargetJoinType= Common.Enum.Sale.OrderJoinTypeEnum.Normal,
CourseId = 0,
StartClassHours = 0,
UpOrderId = 0,
VisitorReserveId = 0,
IsRenewOrder = 1,
JoinType = Common.Enum.Sale.OrderJoinTypeEnum.RenewOrder,
TargetJoinType = Common.Enum.Sale.OrderJoinTypeEnum.Normal,
};
orderModel.RenewOrderId = OrderId;
orderModel.SourceOrderId = OrderId;
......@@ -178,7 +178,7 @@ namespace Edu.WebApi.Controllers.Course
var query = new RB_Class_ViewModel()
{
Group_Id = base.UserInfo.Group_Id,
//School_Id = base.ParmJObj.GetInt("School_Id"),
//School_Id = base.ParmJObj.GetInt("School_Id"),
ClassType = base.ParmJObj.GetInt("ClassType"),
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
......@@ -198,11 +198,13 @@ namespace Edu.WebApi.Controllers.Course
/// 获取学生的当日出勤情况
/// </summary>
/// <returns></returns>
public ApiResult GetStudentAttendanceDayStatistics() {
public ApiResult GetStudentAttendanceDayStatistics()
{
var userInfo = base.UserInfo;
RB_Class_Check_ViewModel demodel = JsonHelper.DeserializeObject<RB_Class_Check_ViewModel>(RequestParm.Msg.ToString());
demodel.Group_Id = userInfo.Group_Id;
if (string.IsNullOrEmpty(demodel.StartDate)) {
if (string.IsNullOrEmpty(demodel.StartDate))
{
return ApiResult.ParamIsNull("请传递日期");
}
......@@ -211,5 +213,99 @@ namespace Edu.WebApi.Controllers.Course
}
#endregion
#region 学员管理
/// <summary>
/// 获取学员列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAllStudentPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var model = new RB_Order_Guest_Extend
{
School_Id = base.ParmJObj.GetInt("School_Id", 0),
CourseId = base.ParmJObj.GetInt("CourseId"),
ClassId = base.ParmJObj.GetInt("ClassId", 0),
GuestName = base.ParmJObj.GetStringValue("GuestName"),
ClassNo = base.ParmJObj.GetStringValue("ClassNo"),
OrderId = base.ParmJObj.GetInt("OrderId", 0),
EnterID = base.ParmJObj.GetInt("EnterID", 0),
EffectStatus = base.ParmJObj.GetInt("EffectStatus", 0),
JoinType = base.ParmJObj.GetInt("JoinType", 0),
EarlyWarning = (Common.Enum.Course.GuestClassHoursEarlyWarningEnum)base.ParmJObj.GetInt("EarlyWarning", 0),
};
try
{
string OrderTime = base.ParmJObj.GetStringValue("OrderTime");
if (!string.IsNullOrWhiteSpace(OrderTime))
{
model.OrderTime = Convert.ToDateTime(OrderTime);
}
string EndOrderTime = base.ParmJObj.GetStringValue("EndOrderTime");
if (!string.IsNullOrWhiteSpace(EndOrderTime))
{
model.EndOrderTime = Convert.ToDateTime(EndOrderTime);
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAllStudentPage");
}
model.Group_Id = base.UserInfo.Group_Id;
var list = studentBillModule.GetAllStudentPage(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, model);
List<object> result = new List<object>();
foreach (var item in list)
{
if (item.EnterID > 0)
{
item.EnterName = UserReidsCache.GetUserLoginInfo(item.EnterID)?.AccountName ?? "";
}
result.Add(new
{
item.Id,
item.GuestName,
item.Mobile,
item.ContractId,
item.ContractNo,
item.ClassId,
item.ClassName,
item.CourseId,
item.CourseName,
item.Teacher_Id,
item.TeacherName,
item.OrderId,
item.OrderTime,
item.EnterID,
item.EnterName,
item.PreferPrice,
item.Income,
item.Refund,
item.TotalHours,
item.ValidClassHours,
item.CompleteHours,
item.SurplusHours,
item.MakeUpHours,
item.AbsenceNum,
item.LeaveNum,
item.EventlogNum,
item.GuestState,
item.GuestStateStr,
item.School_Id,
item.JoinType,
item.JoinTypeStr,
item.Student_Id
});
}
pageModel.Count = rowsCount;
pageModel.PageData = result;
return ApiResult.Success(data: pageModel);
}
#endregion
}
}
......@@ -7,6 +7,7 @@ using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.User;
using Edu.Module.Course;
using Edu.Module.Finance;
using Edu.WebApi.Filter;
......@@ -258,11 +259,13 @@ namespace Edu.WebApi.Controllers.Course
item.IsRenewOrder,
item.RenewOrderId,
item.JoinType,
JoinTypeName=item.JoinType.ToName(),
JoinTypeName = item.JoinType.ToName(),
item.TargetJoinType,
TargetJoinTypeName=item.TargetJoinType.ToName(),
TargetJoinTypeName = item.TargetJoinType.ToName(),
item.TargetOrderId,
item.SourceOrderId,
item.StudentId,
item.StudentEventLogNum
});
}
pageModel.Count = rowsCount;
......@@ -271,6 +274,128 @@ namespace Edu.WebApi.Controllers.Course
}
#region 学员事件记录
/// <summary>
/// 获取学员事件记录分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStudentEventLogPageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_EventLog_ViewModel()
{
StuId = base.ParmJObj.GetInt("StuId"),
EventType = base.ParmJObj.GetInt("EventType")
};
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
var list = classModule.GetStudentEventLogPageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
if (item.UpdateBy > 0)
{
item.UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "";
}
if (!string.IsNullOrWhiteSpace(item.EventPic))
{
item.EventPicList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(item.EventPic);
}
else
{
item.EventPicList = new List<string>();
}
result.Add(new
{
item.EventPicList,
item.EventPic,
item.Id,
item.EventType,
item.CreateByName,
item.EventContent,
item.Title,
CreateTime = item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
});
}
pageModel.Count = rowsCount;
pageModel.PageData = result;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 新增学员事件记录
/// </summary>
/// <returns></returns>
public ApiResult GetSetStudentEventLog()
{
var query = new RB_Student_EventLog_ViewModel()
{
StuId = base.ParmJObj.GetInt("StuId"),
Id = base.ParmJObj.GetInt("Id"),
School_Id = base.ParmJObj.GetInt("School_Id"),
EventType = base.ParmJObj.GetInt("EventType"),
EventContent = base.ParmJObj.GetStringValue("EventContent"),
Title = base.ParmJObj.GetStringValue("Title"),
};
try
{
query.EventPicList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(base.ParmJObj.GetStringValue("EventPicList"));
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetSetStudentEventLog");
}
if (query.EventPicList != null && query.EventPicList.Any())
{
query.EventPic = Common.Plugin.JsonHelper.Serialize(query.EventPicList);
}
else
{
query.EventPic = "";
}
if (string.IsNullOrWhiteSpace(query.Title))
{
return ApiResult.Failed("学员事件记录标题不能为空");
}
if (string.IsNullOrWhiteSpace(query.EventContent))
{
return ApiResult.Failed("学员事件记录内容不能为空");
}
if (query.EventType != 1 && query.EventType != 2)
{
return ApiResult.Failed("学员事件记录类型错误");
}
query.Group_Id = base.UserInfo.Group_Id;
query.Status = Common.Enum.DateStateEnum.Normal;
if (query.Id == 0)
{
query.CreateBy = base.UserInfo.Id;
query.CreateTime = System.DateTime.Now;
}
query.UpdateBy = base.UserInfo.Id;
query.UpdateTime = System.DateTime.Now;
var result = classModule.SetStudentEventLog(query);
return result ? ApiResult.Success("添加学员事件记录成功") : ApiResult.Failed("添加学员事件记录失败");
}
/// <summary>
/// 删除学员事件记录
/// </summary>
/// <returns></returns>
public ApiResult GetDelStudentEventLog()
{
int Id = base.ParmJObj.GetInt("Id");
var result = classModule.DelStudentEventLog(Id,base.UserInfo.Id);
return result ? ApiResult.Success("删除学员事件记录成功") : ApiResult.Failed("删除学员事件记录失败");
}
#endregion
/// <summary>
......
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