Commit 12269c0f authored by 黄奎's avatar 黄奎

1111

parent 5ae79b5b
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Survey
{
/// <summary>
/// 学生意见调查信息主表
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Education_SurveyMain
{
/// <summary>
/// 问卷Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 问卷名称
/// </summary>
public string Title { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { 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; }
/// <summary>
/// 删除状态(0-正常,1-删除)
/// </summary>
public DateStateEnum Status { get; set; }
}
}
...@@ -38,5 +38,10 @@ namespace Edu.Model.Entity.Survey ...@@ -38,5 +38,10 @@ namespace Edu.Model.Entity.Survey
/// 删除 /// 删除
/// </summary> /// </summary>
public DateStateEnum State { get; set; } public DateStateEnum State { get; set; }
/// <summary>
/// 主表问卷Id
/// </summary>
public int MainId { get; set; }
} }
} }
...@@ -98,5 +98,10 @@ namespace Edu.Model.Entity.Survey ...@@ -98,5 +98,10 @@ namespace Edu.Model.Entity.Survey
get; get;
set; set;
} }
/// <summary>
/// 主表文件Id
/// </summary>
public int MainId { get; set; }
} }
} }
using Edu.Model.Entity.Survey;
namespace Edu.Model.ViewModel.Survey
{
/// <summary>
/// 学生意见调查信息主表扩展实体类
/// </summary>
public class RB_Education_SurveyMain_ViewModel: RB_Education_SurveyMain
{
/// <summary>
/// 题目数量
/// </summary>
public int QuestionCount { get; set; }
}
}
...@@ -10,6 +10,11 @@ namespace Edu.Model.ViewModel.Survey ...@@ -10,6 +10,11 @@ namespace Edu.Model.ViewModel.Survey
/// </summary> /// </summary>
public class Rb_Education_StudentSurvey_ViewModel : Rb_Education_StudentSurvey public class Rb_Education_StudentSurvey_ViewModel : Rb_Education_StudentSurvey
{ {
/// <summary>
/// 问卷名称
/// </summary>
public string Title { get; set; }
/// <summary> /// <summary>
/// 选项详情 /// 选项详情
/// </summary> /// </summary>
......
...@@ -10,6 +10,16 @@ namespace Edu.Model.ViewModel.Survey ...@@ -10,6 +10,16 @@ namespace Edu.Model.ViewModel.Survey
/// </summary> /// </summary>
public class Rb_Education_Survey_ViewModel : Rb_Education_Survey public class Rb_Education_Survey_ViewModel : Rb_Education_Survey
{ {
/// <summary>
/// 问卷Id
/// </summary>
public string QSurveyIDs { get; set; }
/// <summary>
/// 问卷编号
/// </summary>
public string QMainIds { get; set; }
/// <summary> /// <summary>
/// 选项 /// 选项
/// </summary> /// </summary>
......
using Edu.Common.Enum;
using Edu.Model.Entity.Survey;
using Edu.Model.ViewModel.Survey;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Survey
{
/// <summary>
/// 学生意见调查信息主表仓储层
/// </summary>
public class RB_Education_SurveyMainRepository:BaseRepository<RB_Education_SurveyMain>
{
/// <summary>
/// 获取意见调查表主表分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Education_SurveyMain_ViewModel> GetEducationSurveyMainPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Education_SurveyMain_ViewModel query)
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT A.* FROM RB_Education_SurveyMain AS A WHERE 1=1 ");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Education_SurveyMain_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Education_SurveyMain_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Title))
{
builder.AppendFormat(" AND A.{0} LIKE @Title ", nameof(RB_Education_SurveyMain_ViewModel.Title));
parameters.Add("@Title", "%" + query.Title.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.Id DESC ");
return GetPage<RB_Education_SurveyMain_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取意见调查表主表列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Education_SurveyMain_ViewModel> GetEducationSurveyMainListRepository(RB_Education_SurveyMain_ViewModel query)
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT A.* FROM RB_Education_SurveyMain AS A WHERE 1=1 ");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Education_SurveyMain_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Education_SurveyMain_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Title))
{
builder.AppendFormat(" AND A.{0} LIKE @Title ", nameof(RB_Education_SurveyMain_ViewModel.Title));
parameters.Add("@Title", "%" + query.Title.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.Id DESC ");
return Get<RB_Education_SurveyMain_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
...@@ -85,8 +85,9 @@ WHERE a.state=0"); ...@@ -85,8 +85,9 @@ WHERE a.state=0");
var parameters = new DynamicParameters(); var parameters = new DynamicParameters();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append($@" sb.Append($@"
SELECT a.*,IFNULL(c.ScoreNum,0) AS ScoreNum,IFNULL(c.ScoreCount,0) AS ScoreCount SELECT a.*,IFNULL(B.Title,'') AS Title,IFNULL(c.ScoreNum,0) AS ScoreNum,IFNULL(c.ScoreCount,0) AS ScoreCount
FROM {TableName} AS a FROM {TableName} AS a
LEFT JOIN rb_education_surveymain AS B ON A.MainId=B.Id
LEFT JOIN (SELECT StudentSurveyId,SUM(ScoreNum) as ScoreNum,COUNT(StudentSurveyId) as ScoreCount FROM Rb_Education_StudentSurveyDetails WHERE ScoreNum>0 GROUP BY StudentSurveyId ) as c ON a.ID=c.StudentSurveyId LEFT JOIN (SELECT StudentSurveyId,SUM(ScoreNum) as ScoreNum,COUNT(StudentSurveyId) as ScoreCount FROM Rb_Education_StudentSurveyDetails WHERE ScoreNum>0 GROUP BY StudentSurveyId ) as c ON a.ID=c.StudentSurveyId
WHERE a.state=0"); WHERE a.state=0");
if (where != null) if (where != null)
...@@ -108,8 +109,12 @@ WHERE a.state=0"); ...@@ -108,8 +109,12 @@ WHERE a.state=0");
{ {
sb.AppendFormat(" AND A.CreateDate<='{0} 23:59:59' ", where.QEndDate); sb.AppendFormat(" AND A.CreateDate<='{0} 23:59:59' ", where.QEndDate);
} }
if (where.MainId > 0)
{
sb.AppendFormat(" and a.MainId={0}", where.MainId);
}
} }
sb.AppendFormat(" ORDER BY A.CreateDate ASC "); sb.AppendFormat(" ORDER BY A.CreateDate DESC ");
return GetPage<Rb_Education_StudentSurvey_ViewModel>(pageIndex, pageSize, out rowsCount, sb.ToString(), parameters).ToList(); return GetPage<Rb_Education_StudentSurvey_ViewModel>(pageIndex, pageSize, out rowsCount, sb.ToString(), parameters).ToList();
} }
......
...@@ -4,6 +4,7 @@ using System; ...@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Survey namespace Edu.Repository.Survey
{ {
...@@ -12,62 +13,53 @@ namespace Edu.Repository.Survey ...@@ -12,62 +13,53 @@ namespace Edu.Repository.Survey
/// </summary> /// </summary>
public class Rb_Education_SurveyRepository : BaseRepository<Rb_Education_Survey> public class Rb_Education_SurveyRepository : BaseRepository<Rb_Education_Survey>
{ {
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(Rb_Education_Survey); } }
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
/// <param name="where"></param> /// <param name="where"></param>
/// <returns></returns> /// <returns></returns>
public List<Rb_Education_Survey_ViewModel> GetList(Rb_Education_Survey where) public List<Rb_Education_Survey_ViewModel> GetEducationSurveyListRepository(Rb_Education_Survey_ViewModel where)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from Rb_Education_Survey where state=0"); DynamicParameters parameters = new DynamicParameters();
sb.Append($@"SELECT * FROM Rb_Education_Survey WHERE state=0");
if (where != null) if (where != null)
{ {
if (where.RB_Group_Id > 0) if (where.RB_Group_Id > 0)
{ {
sb.AppendFormat(" and RB_Group_Id={0}", where.RB_Group_Id); sb.AppendFormat(" AND RB_Group_Id={0}", where.RB_Group_Id);
} }
if (where.IsShow > 0) if (where.IsShow > 0)
{ {
sb.AppendFormat(" and IsShow={0}", where.IsShow); sb.AppendFormat(" AND IsShow={0}", where.IsShow);
} }
if (!string.IsNullOrWhiteSpace(where.Title)) if (!string.IsNullOrWhiteSpace(where.Title))
{ {
sb.AppendFormat(" and Title like'%{0}%'", where.Title); sb.AppendFormat(" AND Title LIKE @Title");
parameters.Add("@Title", "%" + where.Title + "%");
} }
if (where.SurveyType.HasValue && (int)where.SurveyType > 0) if (where.SurveyType.HasValue && (int)where.SurveyType > 0)
{ {
sb.AppendFormat(" and SurveyType={0}", (int)where.SurveyType); sb.AppendFormat(" AND SurveyType={0}", (int)where.SurveyType);
} }
if (!string.IsNullOrWhiteSpace(where.QSurveyIDs))
{
sb.AppendFormat(" AND ID in({0})", where.QSurveyIDs);
} }
sb.Append($" ORDER BY {nameof(Rb_Education_Survey.Sort)} ASC"); if (!string.IsNullOrEmpty(where.QMainIds))
return Get<Rb_Education_Survey_ViewModel>(sb.ToString()).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="SurveyIDs"></param>
/// <returns></returns>
public List<Rb_Education_Survey_ViewModel> GetList(string SurveyIDs)
{ {
StringBuilder sb = new StringBuilder(); sb.AppendFormat(" AND MainId in({0})", where.QMainIds);
sb.Append($@"SELECT * from Rb_Education_Survey where state=0"); }
if (where.MainId > 0)
if (!string.IsNullOrWhiteSpace(SurveyIDs))
{ {
sb.AppendFormat(" and ID in({0})", SurveyIDs); sb.AppendFormat(" AND MainId in({0})", where.MainId);
}
} }
sb.Append($" ORDER BY {nameof(Rb_Education_Survey.Sort)} ASC"); sb.Append($" ORDER BY {nameof(Rb_Education_Survey.Sort)} ASC");
return Get<Rb_Education_Survey_ViewModel>(sb.ToString()).ToList(); return Get<Rb_Education_Survey_ViewModel>(sb.ToString(), parameters).ToList();
} }
/// <summary> /// <summary>
/// 意见调查表配置项分页列表 /// 意见调查表配置项分页列表
/// </summary> /// </summary>
...@@ -76,28 +68,33 @@ namespace Edu.Repository.Survey ...@@ -76,28 +68,33 @@ namespace Edu.Repository.Survey
/// <param name="rowsCount"></param> /// <param name="rowsCount"></param>
/// <param name="where"></param> /// <param name="where"></param>
/// <returns></returns> /// <returns></returns>
public List<Rb_Education_Survey_ViewModel> GetPageList(int pageIndex, int pageSize, out long rowsCount, Rb_Education_Survey where) public List<Rb_Education_Survey_ViewModel> GetEducationSurveyPageRepository(int pageIndex, int pageSize, out long rowsCount, Rb_Education_Survey where)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from Rb_Education_Survey where state=0"); DynamicParameters parameters = new DynamicParameters();
sb.Append($@"SELECT A.* FROM Rb_Education_Survey AS A WHERE A.state=0");
if (where != null) if (where != null)
{ {
if (where.IsShow > -1) if (where.IsShow > -1)
{ {
sb.AppendFormat(" and IsShow={0}", where.IsShow); sb.AppendFormat(" AND A.IsShow={0}", where.IsShow);
} }
if (where.SurveyType.HasValue && (int)where.SurveyType > 0) if (where.SurveyType.HasValue && (int)where.SurveyType > 0)
{ {
sb.AppendFormat(" and SurveyType={0}", (int)where.SurveyType); sb.AppendFormat(" AND A.SurveyType={0}", (int)where.SurveyType);
} }
if (!string.IsNullOrWhiteSpace(where.Title)) if (!string.IsNullOrWhiteSpace(where.Title))
{ {
sb.AppendFormat(" and Title like'%{0}%'", where.Title); sb.AppendFormat(" AND A.Title LIKE @Title");
parameters.Add("@Title", "%" + where.Title + "%");
}
if (where.MainId > 0)
{
sb.AppendFormat(" AND A.MainId={0} ", where.MainId);
} }
} }
sb.Append($" ORDER BY {nameof(Rb_Education_Survey.Sort)} ASC"); sb.Append($" ORDER BY {nameof(Rb_Education_Survey.Sort)} ASC");
return GetPage<Rb_Education_Survey_ViewModel>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList(); return GetPage<Rb_Education_Survey_ViewModel>(pageIndex, pageSize, out rowsCount, sb.ToString(), parameters).ToList();
} }
} }
} }
...@@ -14,7 +14,7 @@ namespace Edu.ThirdCore.Message ...@@ -14,7 +14,7 @@ namespace Edu.ThirdCore.Message
/// </summary> /// </summary>
public class MessageCore public class MessageCore
{ {
private static bool IsFinish = true; //private static bool IsFinish = true;
public static void Init() public static void Init()
{ {
//while (QueueHelper.Queue.Count == 0 || !IsFinish) //while (QueueHelper.Queue.Count == 0 || !IsFinish)
...@@ -47,7 +47,7 @@ namespace Edu.ThirdCore.Message ...@@ -47,7 +47,7 @@ namespace Edu.ThirdCore.Message
{ {
Console.WriteLine(ex.Message); Console.WriteLine(ex.Message);
} }
IsFinish = true; //IsFinish = true;
} }
private static void SendSMS(JObject obj) private static void SendSMS(JObject obj)
...@@ -99,6 +99,10 @@ namespace Edu.ThirdCore.Message ...@@ -99,6 +99,10 @@ namespace Edu.ThirdCore.Message
/// <param name="phoneNumber"></param> /// <param name="phoneNumber"></param>
/// <param name="SendDate"></param> /// <param name="SendDate"></param>
/// <param name="BizId"></param> /// <param name="BizId"></param>
/// <param name="Domain"></param>
/// <param name="AccessKeyId"></param>
/// <param name="AccessKeySecret"></param>
/// <param name="RegionId"></param>
/// <returns></returns> /// <returns></returns>
public static string SendSMSStatus(string phoneNumber, string SendDate, string BizId, string Domain, string AccessKeyId, string AccessKeySecret, string RegionId) public static string SendSMSStatus(string phoneNumber, string SendDate, string BizId, string Domain, string AccessKeyId, string AccessKeySecret, string RegionId)
{ {
......
...@@ -865,7 +865,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -865,7 +865,7 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult SetAdminScrollAppointment_V3() public ApiResult SetAdminScrollAppointment_V3()
{ {
var userInfo = base.UserInfo; var userInfo = base.UserInfo;
RB_Scroll_Appointment_ViewModel demodel = new RB_Scroll_Appointment_ViewModel() RB_Scroll_Appointment_ViewModel demodel = new RB_Scroll_Appointment_ViewModel
{ {
CourseId = base.ParmJObj.GetInt("CourseId"), CourseId = base.ParmJObj.GetInt("CourseId"),
CourseGradeNo = base.ParmJObj.GetInt("CourseGradeNo"), CourseGradeNo = base.ParmJObj.GetInt("CourseGradeNo"),
...@@ -874,13 +874,13 @@ namespace Edu.WebApi.Controllers.Course ...@@ -874,13 +874,13 @@ namespace Edu.WebApi.Controllers.Course
ShiftSort = base.ParmJObj.GetStringValue("ShiftSort"), ShiftSort = base.ParmJObj.GetStringValue("ShiftSort"),
TeacherId = base.ParmJObj.GetInt("TeacherId"), TeacherId = base.ParmJObj.GetInt("TeacherId"),
ChapterNo = base.ParmJObj.GetInt("ChapterNo"), ChapterNo = base.ParmJObj.GetInt("ChapterNo"),
}; State = CourseAppointStateEnum.WaitSure,
demodel.State = CourseAppointStateEnum.WaitSure; Status = 0,
demodel.Status = 0; Group_Id = userInfo.Group_Id,
demodel.Group_Id = userInfo.Group_Id; CreateBy = userInfo.Id,
demodel.CreateBy = userInfo.Id;
demodel.UpdateBy = userInfo.Id; UpdateBy = userInfo.Id
};
string chooseStuListStr = base.ParmJObj.GetStringValue("ChooseStuList"); string chooseStuListStr = base.ParmJObj.GetStringValue("ChooseStuList");
...@@ -1361,7 +1361,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1361,7 +1361,7 @@ namespace Edu.WebApi.Controllers.Course
List<RB_Scroll_Appointment_ViewModel> AppointList = new List<RB_Scroll_Appointment_ViewModel>(); List<RB_Scroll_Appointment_ViewModel> AppointList = new List<RB_Scroll_Appointment_ViewModel>();
List<RB_Scroll_SkipCourse_ViewModel> SkipList = new List<RB_Scroll_SkipCourse_ViewModel>(); List<RB_Scroll_SkipCourse_ViewModel> SkipList = new List<RB_Scroll_SkipCourse_ViewModel>();
var list = scrollClassModule.GetStuLearnChapterList_V2(demodel, out orderList, out orderGuestList, out AppointList, out SkipList); var list = scrollClassModule.GetStuLearnChapterList_V2(demodel, out orderList, out orderGuestList, out AppointList, out SkipList);
string excelName = "学员消课.xls";
foreach (var itemStu in list) foreach (var itemStu in list)
{ {
var tempOrderList = orderList.Where(x => x.OrderId == itemStu.OrderId); var tempOrderList = orderList.Where(x => x.OrderId == itemStu.OrderId);
...@@ -1457,17 +1457,16 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1457,17 +1457,16 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult GetStuLearnChapterStatic() public ApiResult GetStuLearnChapterStatic()
{ {
var userInfo = base.UserInfo; var userInfo = base.UserInfo;
StuCourseQuery demodel = new StuCourseQuery() StuCourseQuery demodel = new StuCourseQuery
{ {
TeacherAccountId = base.ParmJObj.GetInt("TeacherAccountId"), TeacherAccountId = base.ParmJObj.GetInt("TeacherAccountId"),
CourseId = base.ParmJObj.GetInt("CourseId"), CourseId = base.ParmJObj.GetInt("CourseId"),
CourseRate = (CourseRateEnum)base.ParmJObj.GetInt("CourseRate"), CourseRate = (CourseRateEnum)base.ParmJObj.GetInt("CourseRate"),
Student_Id = base.ParmJObj.GetInt("Student_Id"), Student_Id = base.ParmJObj.GetInt("Student_Id"),
GuestState = (GuestStateEnum)base.ParmJObj.GetInt("GuestState") GuestState = (GuestStateEnum)base.ParmJObj.GetInt("GuestState"),
Group_Id = userInfo.Group_Id
}; };
demodel.Group_Id = userInfo.Group_Id;
var list = scrollClassModule.GetStuLearnChapterStaticModule(demodel, out int MaxLength); var list = scrollClassModule.GetStuLearnChapterStaticModule(demodel, out int MaxLength);
return ApiResult.Success("", new return ApiResult.Success("", new
{ {
...@@ -1486,7 +1485,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1486,7 +1485,7 @@ namespace Edu.WebApi.Controllers.Course
public FileContentResult DownLoadStuLearnChapterStatic() public FileContentResult DownLoadStuLearnChapterStatic()
{ {
var userInfo = base.UserInfo; var userInfo = base.UserInfo;
StuCourseQuery demodel = new StuCourseQuery() StuCourseQuery demodel = new StuCourseQuery
{ {
TeacherAccountId = base.ParmJObj.GetInt("TeacherAccountId"), TeacherAccountId = base.ParmJObj.GetInt("TeacherAccountId"),
CourseId = base.ParmJObj.GetInt("CourseId"), CourseId = base.ParmJObj.GetInt("CourseId"),
...@@ -1494,10 +1493,9 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1494,10 +1493,9 @@ namespace Edu.WebApi.Controllers.Course
Student_Id = base.ParmJObj.GetInt("Student_Id"), Student_Id = base.ParmJObj.GetInt("Student_Id"),
GuestState = (GuestStateEnum)base.ParmJObj.GetInt("GuestState"), GuestState = (GuestStateEnum)base.ParmJObj.GetInt("GuestState"),
StuName = base.ParmJObj.GetStringValue("StuName"), StuName = base.ParmJObj.GetStringValue("StuName"),
ClassScrollType = base.ParmJObj.GetInt("ClassScrollType", 0) ClassScrollType = base.ParmJObj.GetInt("ClassScrollType", 0),
Group_Id = userInfo.Group_Id
}; };
demodel.Group_Id = userInfo.Group_Id;
var list = scrollClassModule.GetStuLearnChapterStaticModule(demodel, out int MaxLength); var list = scrollClassModule.GetStuLearnChapterStaticModule(demodel, out int MaxLength);
string excelName = "学员消课.xls"; string excelName = "学员消课.xls";
......
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