Commit 18024c5f authored by 黄奎's avatar 黄奎

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents b60446c7 3361ed64
......@@ -436,6 +436,43 @@ namespace Edu.Common
return OrderSplitClassFlowId;
}
}
/// <summary>
/// 学生请假流程编号
/// </summary>
public static int StudentLeaveFlowId
{
get
{
int.TryParse(ReadConfigKey("StudentLeaveFlowId"), out int StudentLeaveFlowId);
return StudentLeaveFlowId;
}
}
/// <summary>
/// 组卷审批流程编号
/// </summary>
public static int ZuJuanFlowId
{
get
{
int.TryParse(ReadConfigKey("ZuJuanFlowId"), out int ZuJuanFlowId);
return ZuJuanFlowId;
}
}
/// <summary>
/// 考试申请流程编号
/// </summary>
public static int ExamApplyFlowId
{
get
{
int.TryParse(ReadConfigKey("ExamApplyFlowId"), out int ExamApplyFlowId);
return ExamApplyFlowId;
}
}
/// <summary>
......
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Exam
{
/// <summary>
/// 考试单据审核流程
/// </summary>
public enum ExamineStatusEnum
{
/// <summary>
/// 未审核
/// </summary>
[EnumField("未审核")]
NotAudit = 0,
/// <summary>
/// 审核中
/// </summary>
[EnumField("审核中")]
AuditIng = 1,
/// <summary>
/// 通过
/// </summary>
[EnumField("审核通过")]
AuditThrough = 2,
/// <summary>
/// 不通过
/// </summary>
[EnumField("审核不通过")]
AuditNotThrough = 3,
/// <summary>
/// 驳回
/// </summary>
[EnumField("驳回")]
Rejected = 4,
/// <summary>
/// 作废
/// </summary>
[EnumField("作废")]
Invalid = 5,
}
}
......@@ -48,5 +48,15 @@ namespace Edu.Common.Enum.Finance
/// </summary>
[EnumField("学生请假")]
LeaveClass = 7,
/// <summary>
/// 组卷审批
/// </summary>
[EnumField("组卷审批")]
ZuJuan = 8,
/// <summary>
/// 考试申请
/// </summary>
[EnumField("考试申请")]
ExamApply = 9
}
}
......@@ -13,74 +13,86 @@ namespace Edu.Model.Entity.Exam
[DB(ConnectionName = "DefaultConnection")]
public class RB_Examination_Paper
{
/// <summary>
/// 试卷编号
/// </summary>
public int PaperId { get; set; }
/// <summary>
/// 试卷名称
/// </summary>
public string PaperName { get; set; }
/// <summary>
/// 关联题库编号
/// </summary>
public string QuestionBandIds { get; set; }
/// <summary>
/// 难易程度(1-易,2-中,3-难)
/// </summary>
public DifficultyTypeEnum DifficultyType { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 发布次数
/// </summary>
public int PublishCount { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
/// </summary>
public int GenerateType { get; set; }
/// <summary>
/// 生成试卷套数
/// </summary>
public int CreateNum { get; set; }
/// <summary>
/// 试卷类型(1-文件夹,2-试卷)
/// </summary>
public int PaperType { get; set; }
/// <summary>
/// 父节点编号
/// </summary>
public int ParentId { get; set; }
}
/// <summary>
/// 试卷编号
/// </summary>
public int PaperId { get; set; }
/// <summary>
/// 试卷名称
/// </summary>
public string PaperName { get; set; }
/// <summary>
/// 关联题库编号
/// </summary>
public string QuestionBandIds { get; set; }
/// <summary>
/// 难易程度(1-易,2-中,3-难)
/// </summary>
public DifficultyTypeEnum DifficultyType { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 发布次数
/// </summary>
public int PublishCount { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
/// </summary>
public int GenerateType { get; set; }
/// <summary>
/// 生成试卷套数
/// </summary>
public int CreateNum { get; set; }
/// <summary>
/// 试卷类型(1-文件夹,2-试卷)
/// </summary>
public int PaperType { get; set; }
/// <summary>
/// 父节点编号
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 审核状态
/// </summary>
public Common.Enum.EduTask.EduTaskRrocessStatus ExamineStatus { get; set; }
/// <summary>
/// 审核人
/// </summary>
public int Reviewer { get; set; }
}
}
......@@ -139,5 +139,15 @@ namespace Edu.Model.Entity.Exam
/// 多选题未选全给一半分(1-是)
/// </summary>
public int IsHalfScore { get; set; }
/// <summary>
/// 审核状态
/// </summary>
public Common.Enum.EduTask.EduTaskRrocessStatus ExamineStatus { get; set; }
/// <summary>
/// 审核人
/// </summary>
public int Reviewer { get; set; }
}
}
......@@ -10,6 +10,14 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
public class RB_Examination_Configure_ViewModel : RB_Examination_Configure
{
/// <summary>
/// 审核人名称
/// </summary>
public string ZuJuanReviewerName { get; set; }
/// <summary>
/// 考试申请审核人名称
/// </summary>
public string ExamApplyReviewerName { get; set; }
}
}
......@@ -10,8 +10,10 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
public class RB_Examination_Paper_ViewModel : RB_Examination_Paper
{
/// <summary>
/// 是否从新发起审核0-否,1-是
/// </summary>
public int IsExamine { get; set; }
/// <summary>
/// 试卷题目分组列表
/// </summary>
......
......@@ -24,5 +24,15 @@ namespace Edu.Model.ViewModel.Exam
/// 考生人数
/// </summary>
public int StudentCount { get; set; }
/// <summary>
/// 重新发起审核
/// </summary>
public int IsExamine { get; set; }
/// <summary>
/// 查询id
/// </summary>
public string QPublishIds { get; set; }
}
}
......@@ -8,12 +8,14 @@ using Edu.Model.CacheModel;
using Edu.Model.Entity.EduTask;
using Edu.Model.ViewModel.BackClass;
using Edu.Model.ViewModel.EduTask;
using Edu.Model.ViewModel.Exam;
using Edu.Model.ViewModel.Grade;
using Edu.Model.ViewModel.Sell;
using Edu.Model.ViewModel.User;
using Edu.Repository.BackClass;
using Edu.Repository.Course;
using Edu.Repository.EduTask;
using Edu.Repository.Exam;
using Edu.Repository.Grade;
using Edu.Repository.Sell;
using Edu.Repository.User;
......@@ -111,6 +113,15 @@ namespace Edu.Module.EduTask
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 试卷仓储层对象
/// </summary>
private readonly RB_Examination_PaperRepository examination_PaperRepository = new RB_Examination_PaperRepository();
/// <summary>
/// 考试发布仓储层对象
/// </summary>
private readonly RB_Examination_PublishRepository examination_PublishRepository = new RB_Examination_PublishRepository();
/// <summary>
/// 获取教务单据分页列表
......@@ -160,6 +171,11 @@ namespace Edu.Module.EduTask
List<RB_Class_Time_ViewModel> timeList = new List<RB_Class_Time_ViewModel>();
//订单转班列表
List<RB_Order_Change_ViewModel> orderTransList = new List<RB_Order_Change_ViewModel>();
///试卷列表(组卷审核)
List<RB_Examination_Paper_ViewModel> ExaminationPaperList = new List<RB_Examination_Paper_ViewModel>();
//考试申请列表(考试申请审核)
List<RB_Examination_Publish_ViewModel> ExaminationPublishList = new List<RB_Examination_Publish_ViewModel>();
var groupList = list.GroupBy(qitem => new { qitem.ReceiptType }).Select(qitem => new { qitem.Key.ReceiptType });
string Ids = string.Join(",", list.Select(qitem => qitem.Id));
var recordList = education_RecordRepository.GetEducationRecordListRepository(new RB_Education_Record_ViewModel()
......@@ -406,7 +422,29 @@ namespace Edu.Module.EduTask
}
}
#endregion
#region 组卷审批
if (subItem.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ZuJuan)
{
string transClassIds = string.Join(",", list.Where(qitem => qitem.ReceiptType == subItem.ReceiptType).Select(qitem => qitem.RelationId));
ExaminationPaperList = examination_PaperRepository.GetExaminationPaperListRepository(new RB_Examination_Paper_ViewModel()
{
QPaperIds = transClassIds
});
}
#endregion
#region 考试申请
if (subItem.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ExamApply)
{
string transClassIds = string.Join(",", list.Where(qitem => qitem.ReceiptType == subItem.ReceiptType).Select(qitem => qitem.RelationId));
ExaminationPublishList = examination_PublishRepository.GetExaminationPublishListRepository(new RB_Examination_Publish_ViewModel()
{
QPublishIds = transClassIds
});
}
#endregion
}
......@@ -527,6 +565,17 @@ namespace Edu.Module.EduTask
DataObj = tempModel;
accountName = tempModel.Order_Guest_ViewModel.GuestName;
}
//组卷
if (item.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ZuJuan)
{
DataObj = ExaminationPaperList?.Where(qitem => qitem.PaperId == item.RelationId)?.FirstOrDefault();
}
//考试发布
if (item.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ExamApply)
{
DataObj = ExaminationPublishList?.Where(qitem => qitem.Id == item.RelationId)?.FirstOrDefault();
}
object AuditObj = new object();
if (item.VerifyStatus == EduTaskRrocessStatus.NotAudit || item.VerifyStatus == EduTaskRrocessStatus.AuditIng)
{
......@@ -625,6 +674,22 @@ namespace Edu.Module.EduTask
{
student_StopClassRepository.UpdateStudentStopClass(model.Id, 4);
}
if (model != null && model.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ZuJuan)
{
Dictionary<string, object> filedsZuJuan = new Dictionary<string, object>()
{
{nameof(RB_Examination_Paper_ViewModel.ExamineStatus),(int)EduTaskRrocessStatus.Invalid}
};
flag = education_ReceiptRepository.Update(filedsZuJuan, new WhereHelper(nameof(RB_Examination_Paper_ViewModel.PaperId), model.RelationId));
}
if (model != null && model.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ExamApply)
{
Dictionary<string, object> filedsZuJuan = new Dictionary<string, object>()
{
{nameof(RB_Examination_Publish_ViewModel.ExamineStatus),(int)EduTaskRrocessStatus.Invalid}
};
flag = examination_PublishRepository.Update(filedsZuJuan, new WhereHelper(nameof(RB_Examination_Publish_ViewModel.Id), model.RelationId));
}
}
return flag;
}
......@@ -1326,13 +1391,55 @@ namespace Edu.Module.EduTask
//student_BackClassRepository.UpdateGuestStateRepository(receiptModel, auditModel);
}
}
if (receiptModel.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.OrderSplitClass)
if (receiptModel.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.LeaveClass)
{
if (auditModel.AuditStatus == 2)
{
studentLeaveRepository.UpdateStundetLeave(receiptModel.Id, user.Id);
}
}
if (receiptModel.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ZuJuan)
{
if (auditModel.AuditStatus == 2)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Examination_Paper_ViewModel.ExamineStatus),(int)EduTaskRrocessStatus.AuditThrough}
};
flag = education_ReceiptRepository.Update(fileds, new WhereHelper(nameof(RB_Examination_Paper_ViewModel.PaperId), receiptModel.RelationId));
}
if (auditModel.AuditStatus == 3)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Examination_Paper_ViewModel.ExamineStatus),(int)EduTaskRrocessStatus.Rejected}
};
flag = education_ReceiptRepository.Update(fileds, new WhereHelper(nameof(RB_Examination_Paper_ViewModel.PaperId), receiptModel.RelationId));
}
}
if (receiptModel.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ExamApply)
{
if (auditModel.AuditStatus == 2)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Examination_Paper_ViewModel.ExamineStatus),(int)EduTaskRrocessStatus.AuditThrough}
};
flag = examination_PublishRepository.Update(fileds, new WhereHelper(nameof(RB_Examination_Paper_ViewModel.PaperId), receiptModel.RelationId));
}
if (auditModel.AuditStatus == 3)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Examination_Paper_ViewModel.ExamineStatus),(int)EduTaskRrocessStatus.Rejected}
};
flag = examination_PublishRepository.Update(fileds, new WhereHelper(nameof(RB_Examination_Paper_ViewModel.PaperId), receiptModel.RelationId));
}
}
return flag;
......
This diff is collapsed.
......@@ -153,7 +153,7 @@ WHERE 1=1
public List<RB_Education_Receipt_ViewModel> GetEducationReceiptListRepository(EducationReceiptQuery query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,IFNULL(C.TeacherName,'') AS TeacherName
......@@ -174,7 +174,7 @@ WHERE 1=1
{
builder.AppendFormat(@" AND A.{0} IN ({1}) ", nameof(RB_Education_Receipt_ViewModel.Id), query.QIds);
}
if (query.RelationId>0)
if (query.RelationId > 0)
{
builder.AppendFormat(@" AND A.{0} IN ({1}) ", nameof(RB_Education_Receipt_ViewModel.RelationId), query.RelationId);
}
......@@ -279,13 +279,31 @@ WHERE 1=1
}
else if (model.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.LeaveClass)
{
flowModel = flowRepository.GetFlowRepository(Common.Config.OrderSplitClassFlowId);
flowModel = flowRepository.GetFlowRepository(Common.Config.StudentLeaveFlowId);
if (flowModel == null)
{
message = "未配置学生请假流程!";
return false;
}
}
else if (model.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ZuJuan)
{
flowModel = flowRepository.GetFlowRepository(Common.Config.ZuJuanFlowId);
if (flowModel == null)
{
message = "未配置组卷审批流程!";
return false;
}
}
else if (model.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ExamApply)
{
flowModel = flowRepository.GetFlowRepository(Common.Config.ExamApplyFlowId);
if (flowModel == null)
{
message = "未配置考试申请审批流程!";
return false;
}
}
if (flowModel?.FlowNodeList?.Count == 0)
{
message = "未配置审核流程!";
......@@ -424,7 +442,7 @@ WHERE 1=1
flag = student_BackRecordRepository.Insert(recordModel) > 0;
#region 审核通知
var account = new RB_AccountRepository().GetEmployeeInfo(tItem);
if (account!=null && !string.IsNullOrEmpty(account.WorkUserId))
if (account != null && !string.IsNullOrEmpty(account.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/teacher/change-class-manager?tab=3&id={model.Id}");
var content = $"待审通知 你有一张业务单据等待审核\n>**概要信息** \n>单据信息:<font color='comment'>{EnumHelper.ToName(model.ReceiptType)}单据 ({model.Id})</font>\n>创 建 人:<font color='comment'>{account.EmployeeName}</font>\n>创建时间:<font color='comment'>{DateTime.Now.ToString("MM-dd HH-mm")}</font>\n>请点击:[查看详情]({Config.ErpUrl}/autologin?loginId={tItem}&target={recipientPath})";
......
......@@ -44,5 +44,40 @@ WHERE 1=1
}
return GetPage<RB_Examination_Publish_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取发布试卷列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Examination_Publish_ViewModel> GetExaminationPublishListRepository(RB_Examination_Publish_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.PaperName,'') AS PaperName
FROM RB_Examination_Publish AS A LEFT JOIN rb_examination_paper AS B ON A.PaperId=B.PaperId
WHERE 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Examination_Publish_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.PaperName))
{
builder.AppendFormat(" AND B.{0} LIKE @PaperName ", nameof(RB_Examination_Publish_ViewModel.PaperName));
parameters.Add("PaperName", "%" + query.PaperName.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.QPublishIds))
{
builder.AppendFormat(" AND A.{0} in ({1}) ", nameof(RB_Examination_Publish_ViewModel.Id), query.QPublishIds);
}
}
return Get<RB_Examination_Publish_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
......@@ -43,7 +43,7 @@ WHERE 1=1
}
if (!string.IsNullOrWhiteSpace(query.GuestName))
{
builder.AppendFormat(" AND B.{0}={1} ", nameof(RB_Examination_Student_ViewModel.GuestName), query.GuestName);
builder.AppendFormat(" AND B.{0} like '%{1}%' ", nameof(RB_Examination_Student_ViewModel.GuestName), query.GuestName);
}
}
return GetPage<RB_Examination_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
......
......@@ -97,11 +97,15 @@
"OrderSplitClassFlowId": 6,
//学生请假流程编号
"StudentLeaveFlowId": 7,
"ErpUrl": "http://localhost:8181/#",
//是否开启调课数据验证
"IsOpenChangeClassVerify": 1,
//是否是本地服务
"IsLocal": "1",
//临时Token
"TempToken": "47_oXN2xrKRE9InhFMtcCuFx_8Psl2i9TgCYhdHIsvuii5TweFkXvM1J0miUS1sLiRO5GggPOSQqCL1mfVK_ZR9HzV0JAn12TUKctzrBf2p6cFN0gzSUP88Q-iEA3yNgVkL9-DtNpzPL2stAfD7GTRaAIAANL"
//组卷审批流程编号
"ZuJuanFlowId": 8,
//考试申请流程编号
"ExamApplyFlowId": 9,
"ErpUrl": "http://localhost:8181/#",
//是否开启调课数据验证
"IsOpenChangeClassVerify": 1,
//是否是本地服务
"IsLocal": "1",
//临时Token
"TempToken": "47_oXN2xrKRE9InhFMtcCuFx_8Psl2i9TgCYhdHIsvuii5TweFkXvM1J0miUS1sLiRO5GggPOSQqCL1mfVK_ZR9HzV0JAn12TUKctzrBf2p6cFN0gzSUP88Q-iEA3yNgVkL9-DtNpzPL2stAfD7GTRaAIAANL"
}
\ No newline at end of file
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