Commit 4f1e298a authored by 吴春's avatar 吴春

提交代码

parent 570250cb
......@@ -155,10 +155,6 @@ namespace Edu.Module.Course
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>
/// 获取班级列表
......@@ -3434,78 +3430,6 @@ 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
......
......@@ -7,6 +7,7 @@ using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.User;
using Edu.Repository.Course;
using Edu.Repository.Flow;
using Edu.Repository.Log;
......@@ -68,6 +69,12 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Class_CheckRepository class_CheckRepository = new RB_Class_CheckRepository();
/// <summary>
/// 学员事件记录仓储层
/// </summary>
private readonly RB_Student_EventLogRepository student_EventLogRepository = new RB_Student_EventLogRepository();
/// <summary>
/// 财务配置
/// </summary>
......@@ -238,7 +245,7 @@ namespace Edu.Module.Course
if (classList != null && classList.Count > 0)
{
string courseIds = string.Join(",", classList.Select(qitem => qitem.CouseId));
coursePriceList= course_PreferentialRepository.GetCoursePreferentialListRepostory(new RB_Course_Preferential_Extend()
coursePriceList = course_PreferentialRepository.GetCoursePreferentialListRepostory(new RB_Course_Preferential_Extend()
{
QCourseIds = courseIds
});
......@@ -252,12 +259,12 @@ namespace Edu.Module.Course
{
if (priceModel.PriceType == 0)
{
SellPrice = Math.Round(SellPrice * (100 - priceModel.PriceMoney) / 100,2);
OriginalPrice = Math.Round(SellPrice * (100 - priceModel.PriceMoney) / 100,2);
SellPrice = Math.Round(SellPrice * (100 - priceModel.PriceMoney) / 100, 2);
OriginalPrice = Math.Round(SellPrice * (100 - priceModel.PriceMoney) / 100, 2);
}
else
{
SellPrice = Math.Round(SellPrice - priceModel.PriceMoney,2);
SellPrice = Math.Round(SellPrice - priceModel.PriceMoney, 2);
OriginalPrice = Math.Round(SellPrice - priceModel.PriceMoney, 2);
}
}
......@@ -271,8 +278,8 @@ namespace Edu.Module.Course
item.TeacherName,
item.RoomName,
OpenTime = Common.ConvertHelper.FormatDate(item.OpenTime),
NewOriginalPrice=item.OriginalPrice,
NewSellPrice=item.SellPrice,
NewOriginalPrice = item.OriginalPrice,
NewSellPrice = item.SellPrice,
OriginalPrice,
SellPrice,
item.ClassPersion,
......@@ -416,6 +423,97 @@ namespace Edu.Module.Course
return orderstudentList;
}
/// <summary>
/// 获取签到状态记录
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetClassCheckPageList(int pageIndex, int pageSize, out long rowsCount, RB_Class_Check_ViewModel query)
{
return class_CheckRepository.GetClassCheckPageList(pageIndex, pageSize, out rowsCount, query);
}
/// <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
}
}
......@@ -149,7 +149,7 @@ WHERE 1=1 AND `Status` =0 and CheckStatus =0 ");
/// </summary>
/// <param name="guestIds">学员编号</param>
/// <returns></returns>
public List<GuestFinishMinute_ViewModel> GetGuestFinishMinutesRepository(string guestIds,int ClassCheckId=0)
public List<GuestFinishMinute_ViewModel> GetGuestFinishMinutesRepository(string guestIds, int ClassCheckId = 0)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
......@@ -458,13 +458,16 @@ GROUP BY tt.TeacherId,tt.OrderGuestId
public List<RB_Class_Check_ViewModel> GetTeacherConsumptionHoursDetialPageList(int pageIndex, int pageSize, out long count, int teacherId, int schoolId, int classId, string startMonth, string endMonth, int group_Id)
{
string where = $@" ";
if (teacherId > 0) {
if (teacherId > 0)
{
where += $@" and p.TeacherId ={teacherId}";
}
if (schoolId >= 0) {
if (schoolId >= 0)
{
where += $@" and t2.School_Id ={schoolId}";
}
if (classId > 0) {
if (classId > 0)
{
where += $@" and p.ClassId ={classId}";
}
......@@ -502,7 +505,8 @@ ORDER BY p.ClassDate ASC
{
where += $@" and t2.School_Id ={schoolId}";
}
if (classId > 0) {
if (classId > 0)
{
where += $@" and p.ClassId ={classId}";
}
......@@ -535,7 +539,7 @@ ORDER BY p.ClassDate ASC
/// <param name="contractNo"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialPageList(int pageIndex, int pageSize, out long count, int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId,int StudentId)
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialPageList(int pageIndex, int pageSize, out long count, int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, int StudentId)
{
string where = $@" ";
if (teacherId > 0)
......@@ -610,7 +614,7 @@ ORDER BY tt.ClassDate ASC
/// <param name="contractNo"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialList(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, string classIds="")
public List<RB_Class_Check_ViewModel> GetStudentConsumptionHoursDetialList(int teacherId, int schoolId, int classId, string startMonth, string endMonth, string studentName, int orderId, string contractNo, int groupId, string classIds = "")
{
string where = $@" ";
if (teacherId > 0)
......@@ -741,13 +745,16 @@ GROUP BY tt.ClassId,tt.OrderGuestId
public List<RB_Class_Check_ViewModel> GetAllClassNowMonthStatistics(string startTime, string endTime, int classId, string classNo, int schoolId, int group_Id)
{
string where = "";
if (classId > 0) {
if (classId > 0)
{
where += " and cc.ClassId =" + classId;
}
if (schoolId >= 0) {
if (schoolId >= 0)
{
where += " and c.School_Id =" + schoolId;
}
if (!string.IsNullOrEmpty(classNo)) {
if (!string.IsNullOrEmpty(classNo))
{
where += " and c.ClassNo ='" + classNo + "'";
}
string sql = $@"
......@@ -761,5 +768,57 @@ LEFT JOIN rb_class c on cc.ClassId = c.ClassId
}
#endregion
#region 学生可补课时/缺勤次数,请假次数
#region
/// <summary>
/// 获取签到状态记录
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Check_ViewModel> GetClassCheckPageList(int pageIndex, int pageSize, out long rowsCount, RB_Class_Check_ViewModel query)
{
StringBuilder builderWhere = new StringBuilder();
StringBuilder builder = new StringBuilder();
StringBuilder builderMakeUp = new StringBuilder();
if (query != null)
{
if (query.Group_Id > 0)
{
builderWhere.AppendFormat(" AND a.{0}={1} ", nameof(RB_Class_Check_ViewModel.Group_Id), query.Group_Id);
}
if (query.OrderGuestId > 0)
{
builderWhere.AppendFormat(" AND a.{0}={1} ", nameof(RB_Class_Check_ViewModel.OrderGuestId), query.OrderGuestId);
}
if (query.CheckStatus > -1)
{
builderWhere.AppendFormat(" AND a.{0}={1} ", nameof(RB_Class_Check_ViewModel.CheckStatus), query.CheckStatus);
if (query.CheckStatus == 1 && query.MakeUpStatus == 2)
{
builderMakeUp.AppendFormat(" INNER JOIN rb_student_makeup as stum on stum.ClassCheckId=a.ClassCheckId and stum.MakeUpStatus=2");
}
}
}
builder.AppendFormat(@" SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,IFNULL(C.ClassName,'') AS ClassName,C.ClassNo,IFNULL(D.CourseName,'') AS CourseName,IFNULL(E.RoomName,'') AS RoomName
,IFNULL(F.TeacherName,'') AS TeacherName,CONCAT(ct.StartTime,'~',ct.EndTime) as TimeBucket
FROM RB_Class_Check AS A {0}
left join rb_class_time ct on ct.ClassTimeId = A.ClassTimeId
LEFT JOIN rb_order_guest AS B ON A.OrderGuestId=B.Id
LEFT JOIN rb_class AS C ON A.ClassId=C.ClassId
LEFT JOIN rb_course AS D ON C.CouseId=D.CourseId
LEFT JOIN rb_class_room AS E ON A.ClassRoomId=E.RoomId
LEFT JOIN rb_teacher AS F ON A.TeacherId=F.TId
WHERE 1=1 AND A.Status=0 {1} ", builderMakeUp.ToString(), builderWhere.ToString());
return GetPage<RB_Class_Check_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
#endregion
#endregion
}
}
using Edu.Model.Entity.Course;
using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
......@@ -264,5 +266,8 @@ where a.`Status`=0 and c.ClassStatus in(1,2) and a.TeacherId={TId} and c.`Sta
}
#endregion
}
}
......@@ -48,6 +48,7 @@ namespace Edu.Repository.User
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_EventLog_ViewModel.EventType), query.EventType);
}
}
builder.AppendFormat(" order by t.{0} desc ", nameof(RB_Student_EventLog_ViewModel.CreateTime));
return GetPage<RB_Student_EventLog_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
......
......@@ -6,6 +6,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.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
......@@ -282,7 +283,7 @@ namespace Edu.WebApi.Controllers.Course
var model = new RB_Order_Guest_Extend
{
School_Id = base.ParmJObj.GetInt("School_Id", 0),
CourseId = base.ParmJObj.GetInt("CourseId"),
CourseId = base.ParmJObj.GetInt("CourseId", 0),
ClassId = base.ParmJObj.GetInt("ClassId", 0),
GuestName = base.ParmJObj.GetStringValue("GuestName"),
ClassNo = base.ParmJObj.GetStringValue("ClassNo"),
......@@ -398,6 +399,174 @@ namespace Edu.WebApi.Controllers.Course
}
/// <summary>
/// 获取学员签到信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetClassCheckPageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Class_Check_ViewModel()
{
OrderGuestId = base.ParmJObj.GetInt("OrderGuestId"),
CheckStatus = base.ParmJObj.GetInt("CheckStatus", 0),
MakeUpStatus= base.ParmJObj.GetInt("MakeUpStatus", 0)
};
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
var list = studentBillModule.GetClassCheckPageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
result.Add(new
{
item.ClassId,
item.ClassName,
item.ClassNo,
item.CouseId,
item.CourseName,
item.ClassRoomId,
item.RoomName,
item.School_Id,
item.TeacherId,
item.TeacherName,
item.GuestName,
ClassDate = item.ClassDate.ToString("yyyy-MM-dd"),
item.TimeBucket,
CreateTime = item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")
});
}
pageModel.Count = rowsCount;
pageModel.PageData = result;
return ApiResult.Success(data: pageModel);
}
#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 = studentBillModule.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 = studentBillModule.SetStudentEventLog(query);
return result ? ApiResult.Success("添加学员事件记录成功") : ApiResult.Failed("添加学员事件记录失败");
}
/// <summary>
/// 删除学员事件记录
/// </summary>
/// <returns></returns>
public ApiResult GetDelStudentEventLog()
{
int Id = base.ParmJObj.GetInt("Id");
var result = studentBillModule.DelStudentEventLog(Id, base.UserInfo.Id);
return result ? ApiResult.Success("删除学员事件记录成功") : ApiResult.Failed("删除学员事件记录失败");
}
#endregion
#endregion
}
}
......@@ -273,128 +273,6 @@ 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