Commit 6e8e1554 authored by 吴春's avatar 吴春

1

parent c8fb1936
......@@ -48,8 +48,10 @@ namespace Edu.Model.ViewModel.DataStatistics
/// </summary>
public string StuProfession { get; set; }
/// <summary>
/// 订单对应的学生信息id
/// </summary>
public int GuestId { get; set; }
/// <summary>
/// 课程名称
......
......@@ -8,7 +8,17 @@ namespace Edu.Model.ViewModel.User
/// <summary>
/// 学员学习章节、月度总结、考试扩展实体类
/// </summary>
public class RB_Student_Study_ViewModel: RB_Student_Study
public class RB_Student_Study_ViewModel : RB_Student_Study
{
}
/// <summary>
/// 其他实体
/// </summary>
public class StudyOther
{
public string Name { get; set; }
public decimal Score { get; set; }
}
}
This diff is collapsed.
......@@ -387,6 +387,7 @@ namespace Edu.Module.User
var followModel = new StudentFollowStatic()
{
StuId = item.StuId,
GuestId = item.GuestId,
StuName = item.StuName,//姓名
StuTel = item.StuTel,
CreateTime = Common.ConvertHelper.FormatDate(item.CreateTime),//报名日期
......
......@@ -202,6 +202,10 @@ ORDER BY r.Id desc ";
{
where += $@" and r.{nameof(RB_Scroll_Appointment_ViewModel.GuestId)} in({demodel.GuestIds})";
}
if (demodel.LearnCourseId > 0)
{
where += $@" and r.{nameof(RB_Scroll_Appointment_ViewModel.LearnCourseId)} ={demodel.LearnCourseId}";
}
if (demodel.CourseId > 0)
{
where += $@" and r.{nameof(RB_Scroll_Appointment_ViewModel.CourseId)} ={demodel.CourseId}";
......
......@@ -170,7 +170,7 @@ GROUP BY A.Student_Id,A.OrderId
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,IFNULL(C.JoinType,0) AS StuJoinType,IFNULL(D.GuestState,0) AS StuGuestState
,C.OrderState,IFNULL(D.TotalHours,0) AS TotalHours,IFNULL(D.CompleteHours,0) AS CompleteHours,IFNULL(B.ClassStatus,0) AS ClassStatus,IFNULL(D.RenewState,0) AS RenewState
,IFNULL(D.GuestName,'') AS GuestName,IFNULL(E.CourseName,'') AS CourseName,IFNULL(C.OrderType,0) AS OrderType,IFNULL(C.SourceId,0) AS SourceId,B.ClassScrollType
,IFNULL(D.GuestName,'') AS GuestName,IFNULL(E.CourseName,'') AS CourseName,IFNULL(E.CourseId,0) as CourseId,IFNULL(C.OrderType,0) AS OrderType,IFNULL(C.SourceId,0) AS SourceId,B.ClassScrollType
FROM RB_Student_OrderGuest AS A INNER JOIN rb_order AS C ON A.OrderId=C.OrderId
INNER JOIN rb_order_guest AS D ON A.GuestId=D.Id
LEFT JOIN RB_student AS stu ON A.Student_Id=stu.StuId
......@@ -522,7 +522,7 @@ FROM rb_student s
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT s.StuId,s.StuName,s.StuTel,s.StuProfession,s.StuPurpose,s.JapanBaseInfo,s.CreateBy
,o.CreateTime,o.PreferPrice,c.CourseName,c.CourseRate
,o.CreateTime,o.PreferPrice,c.CourseName,c.CourseRate,sog.GuestId
FROM rb_student s INNER JOIN rb_student_orderguest sog on sog.Student_Id = s.StuId
INNER JOIN rb_order_guest AS og ON og.Id=sog.GuestId
INNER JOIN rb_order o on sog.OrderId = o.OrderId AND o.JoinType=1 AND o.OrderState<>3
......
using Edu.Model.Entity.User;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.User;
using System;
using System.Collections.Generic;
......@@ -25,6 +26,26 @@ SELECT A.*
FROM RB_Student_Study AS A
WHERE 1=1
");
if (query != null)
{
if (query.CourseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Study_ViewModel.CourseId), query.CourseId);
}
if (query.StuId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Study_ViewModel.StuId), query.StuId);
}
if (query.StudyType > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Study_ViewModel.StudyType), query.StudyType);
}
if (query.ChapterId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Study_ViewModel.ChapterId), query.ChapterId);
}
}
return Get<RB_Student_Study_ViewModel>(builder.ToString()).ToList();
}
}
......
......@@ -4,11 +4,14 @@ using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Query;
using Edu.Model.ViewModel.Scroll;
using Edu.Model.ViewModel.User;
using Edu.Module.Course;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using RabbitMQ.Client.Framing.Impl;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -1220,6 +1223,117 @@ namespace Edu.WebApi.Controllers.Course
var list = scrollClassModule.GetStuLearnChapterList(demodel);
return ApiResult.Success("", list);
}
#region 学习情况 2024-05-06 add by:W
/// <summary>
/// 获取学员学习情况
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStuStudyList()
{
var userInfo = base.UserInfo;
RB_Student_ViewModel demodel = JsonHelper.DeserializeObject<RB_Student_ViewModel>(base.RequestParm.Msg.ToString());
demodel.Group_Id = userInfo.Group_Id;
var list = scrollClassModule.GetStuStudyList(demodel);
return ApiResult.Success("", list);
}
/// <summary>
/// 获取学员学习情况月度总结
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetStuStudyMonthList()
{
var userInfo = base.UserInfo;
RB_Student_ViewModel demodel = JsonHelper.DeserializeObject<RB_Student_ViewModel>(base.RequestParm.Msg.ToString());
demodel.Group_Id = userInfo.Group_Id;
var list = scrollClassModule.GetStuStudyMonthList(demodel);
return ApiResult.Success("", list);
}
/// <summary>
/// 获取学员学习情况
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetStuStudyInfo()
{
var userInfo = base.UserInfo;
RB_Student_Study_ViewModel demodel = new RB_Student_Study_ViewModel()
{
StudyType = base.ParmJObj.GetInt("StudyType", 1),
ChapterId = base.ParmJObj.GetInt("ChapterId", 0),
ID = base.ParmJObj.GetInt("StudyID", 0),
CourseId = base.ParmJObj.GetInt("CourseId", 0),
OrderId = base.ParmJObj.GetInt("OrderId", 0),
GuestId = base.ParmJObj.GetInt("GuestId", 0),
StuId = base.ParmJObj.GetInt("StuId", 0),
Words = base.ParmJObj.GetDecimal("Words"),
Practice = base.ParmJObj.GetDecimal("Practice"),
ReadingAloud = base.ParmJObj.GetDecimal("ReadingAloud"),
StudyValue = base.ParmJObj.GetStringValue("StudyValue"),
Remarks = base.ParmJObj.GetStringValue("Remarks"),
};
string other = base.ParmJObj.GetStringValue("Other");
List<StudyOther> otherList = new List<StudyOther>();
if (!string.IsNullOrWhiteSpace(other))
{
JArray otherListArray = JArray.Parse(other);
if (otherListArray != null && otherListArray.Count > 0)
{
foreach (var jItem in otherListArray)
{
JObject jobj = JObject.Parse(JsonHelper.Serialize(jItem));
string score = jobj.GetStringValue("Score");
string name = jobj.GetStringValue("Name");
if (!string.IsNullOrWhiteSpace(name) || !string.IsNullOrWhiteSpace(score))
{
decimal rScore = 0;
try
{
rScore = !string.IsNullOrWhiteSpace(score) ? Convert.ToDecimal(score) : 0;
}
catch (Exception ex)
{
rScore = 0;
}
otherList.Add(new StudyOther
{
Name = name,
Score = rScore,
});
}
}
}
}
if (otherList != null && otherList.Any())
{
demodel.Other = JsonHelper.Serialize(otherList);
}
else
{
demodel.Other = "";
}
if (demodel.ID == 0)
{
demodel.CreateTime = DateTime.Now;
demodel.CreateBy = userInfo.Id;
}
demodel.UpdateTime = DateTime.Now;
demodel.UpdateBy = userInfo.Id;
var result = scrollClassModule.SetStuStudy(demodel);
return result ? ApiResult.Success("") : ApiResult.Failed("操作失败");
}
#endregion
/// <summary>
/// 获取学员上课列表 2023-12-12 add by:W
/// </summary>
......
......@@ -41,7 +41,7 @@ namespace Edu.WebApi.Controllers.Customer
var query = new RB_Student_Appointment_Extend()
{
StuId = base.ParmJObj.GetInt("StuId"),
Id=base.ParmJObj.GetInt("Id"),
Id = base.ParmJObj.GetInt("Id"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetStudentAppointmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......@@ -54,7 +54,7 @@ namespace Edu.WebApi.Controllers.Customer
item.Id,
item.StuId,
item.AppointmentPoint,
AppointmentTime=Common.ConvertHelper.FormatTime(item.AppointmentTime),
AppointmentTime = Common.ConvertHelper.FormatTime(item.AppointmentTime),
item.Remark,
item.Feedback,
CreateTime = Common.ConvertHelper.FormatTimeStr2(item.CreateTime),
......@@ -124,7 +124,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentAppointment()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentAppointmentModule(Id,base.UserInfo.Id);
var model = customerStudentModule.RemoveStudentAppointmentModule(Id, base.UserInfo.Id);
return ApiResult.Success(data: model);
}
......@@ -232,7 +232,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentFollow()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentFollowModule(Id,base.UserInfo.Id);
var model = customerStudentModule.RemoveStudentFollowModule(Id, base.UserInfo.Id);
return ApiResult.Success(data: model);
}
......@@ -247,7 +247,7 @@ namespace Edu.WebApi.Controllers.Customer
var query = new RB_Student_Visit_Extend()
{
StuId = base.ParmJObj.GetInt("StuId"),
Id=base.ParmJObj.GetInt("Id"),
Id = base.ParmJObj.GetInt("Id"),
};
query.Group_Id = base.UserInfo.Group_Id;
var data = customerStudentModule.GetStudentVisitPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......@@ -291,10 +291,10 @@ namespace Edu.WebApi.Controllers.Customer
{
Id = base.ParmJObj.GetInt("Id"),
StuId = base.ParmJObj.GetInt("StuId"),
School_Id=base.ParmJObj.GetInt("School_Id"),
Date=base.ParmJObj.GetDateTime("Date"),
VisitTime=base.ParmJObj.GetStringValue("VisitTime"),
ReceptionPersion=base.ParmJObj.GetInt("ReceptionPersion"),
School_Id = base.ParmJObj.GetInt("School_Id"),
Date = base.ParmJObj.GetDateTime("Date"),
VisitTime = base.ParmJObj.GetStringValue("VisitTime"),
ReceptionPersion = base.ParmJObj.GetInt("ReceptionPersion"),
Remark = base.ParmJObj.GetStringValue("Remark"),
};
if (extModel.ReceptionPersion <= 0)
......@@ -308,7 +308,7 @@ namespace Edu.WebApi.Controllers.Customer
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
bool flag = customerStudentModule.SetStudentVisitModule(extModel);
return flag ? ApiResult.Success(data:extModel) : ApiResult.Failed();
return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
}
/// <summary>
......@@ -345,7 +345,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult RemoveStudentVisit()
{
var Id = base.ParmJObj.GetInt("Id");
var model = customerStudentModule.RemoveStudentVisitModule(Id,base.UserInfo.Id);
var model = customerStudentModule.RemoveStudentVisitModule(Id, base.UserInfo.Id);
return ApiResult.Success(data: model);
}
......@@ -370,7 +370,7 @@ namespace Edu.WebApi.Controllers.Customer
{
query.Group_Id = base.UserInfo.Group_Id;
}
var data = customerStudentModule.GetStudentLogPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
foreach (var item in data)
......@@ -389,12 +389,12 @@ namespace Edu.WebApi.Controllers.Customer
item.LogId,
item.StuId,
item.LogType,
LogTypeName=item.LogType.ToName(),
LogTypeName = item.LogType.ToName(),
item.LogTitle,
item.LogContent,
item.CreateType,
CreateTypeStr=item.CreateType==1?"系统用户":"同业用户",
CreateTimeStr=Common.ConvertHelper.FormatTimeStr2(item.CreateTime),
CreateTypeStr = item.CreateType == 1 ? "系统用户" : "同业用户",
CreateTimeStr = Common.ConvertHelper.FormatTimeStr2(item.CreateTime),
CreateByName
});
......@@ -426,12 +426,14 @@ namespace Edu.WebApi.Controllers.Customer
item.Student_Id,
item.ClassName,
item.ClassNo,
item.ClassId,
item.TotalHours,
item.CompleteHours,
item.GuestName,
item.CourseName,
item.ClassScrollType,
item.OrderType,
item.CourseId,
});
}
pageModel.Count = rowsCount;
......@@ -449,7 +451,7 @@ namespace Edu.WebApi.Controllers.Customer
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_OrderGuest_ViewModel()
{
Student_Id = base.ParmJObj.GetInt("StuId"),
Student_Id = base.ParmJObj.GetInt("StuId"),
};
var data = customerStudentModule.GetStuOrderGuestContractPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> list = new List<object>();
......@@ -505,7 +507,7 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult SetStudentAssistBatch()
{
var stuIds = base.ParmJObj.GetStringValue("stuIds");
var result = customerStudentModule.SetStudentAssistBatchModule(stuIds,base.UserInfo.Id);
var result = customerStudentModule.SetStudentAssistBatchModule(stuIds, base.UserInfo.Id);
return result.result ? ApiResult.Success(message: result.msg) : ApiResult.Failed(message: result.msg);
}
......@@ -585,8 +587,8 @@ namespace Edu.WebApi.Controllers.Customer
var model = new RB_Stage()
{
Id = base.ParmJObj.GetInt("Id"),
StageName=base.ParmJObj.GetStringValue("StageName"),
No=base.ParmJObj.GetInt("No"),
StageName = base.ParmJObj.GetStringValue("StageName"),
No = base.ParmJObj.GetInt("No"),
};
if (model.No <= 0)
{
......@@ -660,7 +662,7 @@ namespace Edu.WebApi.Controllers.Customer
{
Id = base.ParmJObj.GetInt("Id"),
Name = base.ParmJObj.GetStringValue("Name"),
Info=base.ParmJObj.GetStringValue("Info"),
Info = base.ParmJObj.GetStringValue("Info"),
No = base.ParmJObj.GetInt("No"),
};
if (model.No <= 0)
......@@ -761,8 +763,8 @@ namespace Edu.WebApi.Controllers.Customer
{
var extModel = new RB_LearningGoals_Extend()
{
Id=base.ParmJObj.GetInt("Id"),
Name=base.ParmJObj.GetStringValue("Name"),
Id = base.ParmJObj.GetInt("Id"),
Name = base.ParmJObj.GetStringValue("Name"),
};
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.CreateBy = base.UserInfo.Id;
......@@ -872,7 +874,7 @@ namespace Edu.WebApi.Controllers.Customer
{
Id = base.ParmJObj.GetInt("Id"),
Name = base.ParmJObj.GetStringValue("Name"),
};
string staticTypes = base.ParmJObj.GetStringValue("StaticTypeList");
List<string> Ids = new List<string>();
......
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