Commit 4d7b31e4 authored by liudong1993's avatar liudong1993

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

parents 7b6741c4 5ab3bbf3
......@@ -356,6 +356,18 @@ namespace Edu.Common
}
}
/// <summary>
/// 调课流程编号
/// </summary>
public static int ChangeClassFlowId
{
get
{
int.TryParse(ReadConfigKey("ChangeClassFlowId"), out int ChangeClassFlowId);
return ChangeClassFlowId;
}
}
/// <summary>
/// okr关注事项配置
/// </summary>
......
......@@ -18,11 +18,18 @@ namespace Edu.Common.Enum.User
[EnumField("指定成员")]
SpecifiedMember = 2,
/// <summary>
/// 角色
/// 指定角色
/// </summary>
[EnumField("角色")]
Role = 3
[EnumField("指定角色")]
Role = 3,
/// <summary>
/// 系统角色
/// </summary>
[EnumField("系统角色")]
Post =4,
}
/// <summary>
/// 审核方式
/// </summary>
......
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.EduTask
{
/// <summary>
/// 上课计划调整实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Change_ClassPlan
{
/// <summary>
......
......@@ -39,7 +39,7 @@ namespace Edu.Model.Entity.Flow
public WFTAuditTypeEnum AuditType { get; set; }
/// <summary>
/// 审核人员编号(AuditType为1时使用)
/// 审核人员编号(AuditType为2时使用)
/// </summary>
public int UserId { get; set; }
......@@ -49,7 +49,7 @@ namespace Edu.Model.Entity.Flow
public int IsSpecNode { get; set; }
/// <summary>
/// 1-班级教师,2-关联销售,3-分区校长,4-教务长 AuditType为2时使用
/// AuditType=3【1-班级教师,2-关联销售,3-分区校长,4-教务长】AuditType=4【系统角色】
/// </summary>
public int PostType { get; set; }
......
......@@ -26,6 +26,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 班级编号
/// </summary>
public string ClassNo { get; set; }
/// <summary>
/// 教师名称
/// </summary>
......
......@@ -10,6 +10,9 @@ namespace Edu.Model.ViewModel.EduTask
/// </summary>
public class RB_Education_Receipt_ViewModel : RB_Education_Receipt
{
/// <summary>
/// 是否特殊节点
/// </summary>
public int SpecialNode { get; set; }
}
}
......@@ -38,6 +38,12 @@ namespace Edu.Module.EduTask
}
public bool UpdateChangeClassPlan(int id) {
return change_ClassPlanRepository.UpdateChangeClassPlan(id);
}
/// <summary>
/// 新增修改调课计划
/// </summary>
......
......@@ -106,10 +106,12 @@ namespace Edu.Module.EduTask
item.Title,
item.ReceiptType,
DataObj,
item.SpecialNode,
item.RelationId,
ReceiptTypeName = item.ReceiptType.ToName(),
CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
AuditStatusName = item.VerifyStatus.ToName(),
AuditStatusName = item.VerifyStatus == Common.Enum.Finance.WFRrocessStatus.NotAudit ? "审核中" : item.VerifyStatus.ToName(),
};
result.Add(obj);
}
......@@ -276,6 +278,11 @@ namespace Edu.Module.EduTask
}
}
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Education_Receipt_ViewModel.VerifyStatus),(int)WFRrocessStatus.Rejected}
};
flag = education_ReceiptRepository.Update(fileds, new WhereHelper(nameof(RB_Education_Receipt_ViewModel.Id), receipt.Id));
UpdateOtherModule(receipt, auditModel);
}
//审核通过
......@@ -423,6 +430,12 @@ namespace Edu.Module.EduTask
UpdateOtherModule(receipt, auditModel);
}
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Education_Receipt_ViewModel.VerifyStatus),(int)WFRrocessStatus.AuditThrough}
};
flag= education_ReceiptRepository.Update(fileds, new WhereHelper(nameof(RB_Education_Receipt_ViewModel.Id),receipt.Id));
}
//同时创建下一步审核 复制审核人到审核关联表 创建审核记录表
else
......
......@@ -24,7 +24,7 @@ namespace Edu.Repository.Course
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,IFNULL(C.SName,'') AS SchoolName,IFNULL(D.ClassName,'') AS ClassName,IFNULL(T.TeacherName,'') AS TeacherName
,IFNULL(E.EnterID,0) AS EnterID,IFNULL(F.CourseName,'') AS CourseName
,IFNULL(E.EnterID,0) AS EnterID,IFNULL(F.CourseName,'') AS CourseName,D.ClassNo
FROM RB_Student_BackClass AS A LEFT JOIN rb_order_guest AS B ON A.GuestId=B.Id
LEFT JOIN rb_school AS C ON A.SchoolId=C.SId
LEFT JOIN rb_class AS D ON A.ClassId=D.ClassId
......
......@@ -56,7 +56,7 @@ WHERE 1=1
}
if(!string.IsNullOrEmpty(query.QReserveClassIds))
{
builder.AppendFormat(@" AND A.Id IN(SELECT Visitor_Id FROM rb_visitor_reserve WHERE ReserveClassId IN({1}) )",query.QReserveClassIds);
builder.AppendFormat(@" AND A.Id IN(SELECT Visitor_Id FROM rb_visitor_reserve WHERE ReserveClassId IN({0}) )",query.QReserveClassIds);
}
}
return GetPage<RB_Visitor_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
......@@ -69,7 +69,16 @@ WHERE 1=1
{
//查询当前调课信息
bool flag = false;
var model = GetEntity(Id);
var receiptModel = education_ReceiptRepository.GetEntity(Id);
if (receiptModel == null || receiptModel.Id == 0)
{
return false;
}
if (receiptModel.ReceiptType != Common.Enum.Finance.ReceiptTypeEnum.ChangeClass)
{
return false;
}
var model = GetEntity(receiptModel.RelationId);
if (model == null || model.Id == 0)
{
return false;
......@@ -99,7 +108,7 @@ WHERE 1=1
if (item.ClassDate != newChangePlanItemModel.ClassDate)
{
logContent += string.Format("日期由【{0}】修改为【{1}】.", Common.ConvertHelper.FormatDate(item.ClassDate), Common.ConvertHelper.FormatDate(newChangePlanItemModel.ClassDate));
builder.AppendFormat(" update RB_Class_Plan ClassDate={0} where ClassPlanId ={1};", newChangePlanItemModel.ClassDate, item.ClassPlanId);
builder.AppendFormat(" update RB_Class_Plan SET ClassDate='{0}' where ClassPlanId ={1};", newChangePlanItemModel.ClassDate, item.ClassPlanId);
}
foreach (var itemTime in newChangePlanItemModel.PlanTimeList)
{
......@@ -114,9 +123,9 @@ WHERE 1=1
{
logContent += string.Format("{0}上课结束时间由【{1}】修改为【{2}】.", Common.ConvertHelper.FormatDate(newChangePlanItemModel.ClassDate), oldTimeModel.EndTime, itemTime.EndTime);
}
if (oldTimeModel.StartTime != itemTime.StartTime|| oldTimeModel.EndTime != itemTime.EndTime)
if (oldTimeModel.StartTime != itemTime.StartTime || oldTimeModel.EndTime != itemTime.EndTime)
{
builder.AppendFormat(" update rb_class_time StartTime={0} ,EndTime={1} where ClassTimeId ={1};", itemTime.StartTime, itemTime.EndTime, itemTime.ClassTimeId);
builder.AppendFormat(" update rb_class_time SET StartTime='{0}' ,EndTime='{1}' where ClassTimeId ={2};", itemTime.StartTime, itemTime.EndTime, itemTime.ClassTimeId);
}
}
}
......@@ -127,7 +136,7 @@ WHERE 1=1
if (model.ChangeType == 2)
{
builder.AppendFormat(" update RB_Class_Plan TeacherId={0} where ClassPlanId in(1)", newChangePlanItemList.FirstOrDefault().TeacherId, string.Join(",", oldChangePlanItemList.Select(x => x.TeacherId)));
builder.AppendFormat(" update RB_Class_Plan SET TeacherId={0} where ClassPlanId in(1)", newChangePlanItemList.FirstOrDefault().TeacherId, string.Join(",", oldChangePlanItemList.Select(x => x.TeacherId)));
string tIds = string.Join(",", oldChangePlanItemList.Select(x => x.TeacherId)) + "," + newChangePlanItemList.FirstOrDefault().TeacherId;
var teacherList = teacherRepository.GetTeacherListRepository(new Model.ViewModel.User.RB_Teacher_ViewModel() { QTIds = tIds });
foreach (var item in oldChangePlanItemList)
......@@ -141,7 +150,7 @@ WHERE 1=1
}
else if (model.ChangeType == 3)
{
builder.AppendFormat(" update RB_Class_Plan ClassRoomId={0} where ClassPlanId in(1)", newChangePlanItemList.FirstOrDefault().ClassRoomId, string.Join(",", oldChangePlanItemList.Select(x => x.ClassRoomId)));
builder.AppendFormat(" update RB_Class_Plan SET ClassRoomId={0} where ClassPlanId in(1)", newChangePlanItemList.FirstOrDefault().ClassRoomId, string.Join(",", oldChangePlanItemList.Select(x => x.ClassRoomId)));
string roomIds = string.Join(",", oldChangePlanItemList.Select(x => x.ClassRoomId)) + "," + newChangePlanItemList.FirstOrDefault().ClassRoomId;
var roomList = class_RoomRepository.GetClassRoomListRepository(new Edu.Model.ViewModel.Course.RB_Class_Room_ViewModel() { QRoomIds = roomIds });
foreach (var item in oldChangePlanItemList)
......@@ -183,7 +192,7 @@ WHERE 1=1
}
if (deletePlanList != null && deletePlanList.Any())
{
builder.AppendFormat(" update RB_Class_Plan Status=1 where ClassPlanId in(0);", string.Join(",", deletePlanList.Select(x => x)));
builder.AppendFormat(" update RB_Class_Plan SET Status=1 where ClassPlanId in(0);", string.Join(",", deletePlanList.Select(x => x)));
}
if (deletePlanTimeList != null && deletePlanTimeList.Any())
{
......
......@@ -59,12 +59,17 @@ namespace Edu.Repository.EduTask
public List<RB_Education_Receipt_ViewModel> GetEducationReceiptPageRepository(int pageIndex, int pageSize, out long rowsCount, EducationReceiptQuery query)
{
var parameters = new DynamicParameters();
string isSpecNode = "";
if (query.Conditon == Common.Enum.Course.EduReceiptConditionEnum.WaitAgree)
{
isSpecNode = string.Format(",IFNULL((SELECT SpecialNode FROM rb_Education_relevance WHERE Id IN(SELECT BackrelevanceId FROM rb_education_record WHERE ConditionId=A.Id AND AuditStatus=1 AND AuditEmId={0})),0) AS SpecialNode ", query.CreateBy);
}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
SELECT A.* {0}
FROM RB_Education_Receipt AS A
WHERE 1=1
");
",isSpecNode);
if (query != null)
{
if (query.Group_Id > 0)
......@@ -126,6 +131,9 @@ WHERE 1=1
{
message = "";
bool flag = false;
var newId = base.Insert(model);
model.Id = newId;
flag = newId > 0;
//审核流程
var flowModel = new RB_Flow_ViewModel();
//退课流程
......@@ -138,7 +146,20 @@ WHERE 1=1
return false;
}
}
else if (model.ReceiptType == Common.Enum.Finance.ReceiptTypeEnum.ChangeClass)
{
flowModel = flowRepository.GetFlowRepository(Common.Config.ChangeClassFlowId);
if (flowModel == null)
{
message = "未配置调课流程!";
return false;
}
}
if (flowModel?.FlowNodeList?.Count == 0)
{
message = "未配置审核流程!";
return false;
}
int index = 0;
foreach (var item in flowModel.FlowNodeList)
{
......@@ -209,7 +230,7 @@ WHERE 1=1
var levance = new RB_Education_Relevance()
{
ConditionId = model.RelationId,
ConditionId = model.Id,
AuditDescription = item.NodeName,
AuditedId = "",
AuditWay = item.FlowAduitList[0].AuditWay,
......@@ -233,7 +254,7 @@ WHERE 1=1
{
var recordModel = new RB_Education_Record_ViewModel()
{
ConditionId = model.RelationId,
ConditionId = model.Id,
AuditStatus = Common.Enum.User.WFRrocessStatus.NotAudit,
AuditId = levance.Id,
AuditEmId = subItem.UserId,
......@@ -250,9 +271,6 @@ WHERE 1=1
}
index++;
}
var newId = base.Insert(model);
model.Id = newId;
flag = newId > 0;
return flag;
}
}
......
......@@ -51,6 +51,7 @@ WHERE 1=1
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.IsRead), query.IsRead);
}
}
builder.AppendFormat(" ORDER BY {0} DESC ", nameof(RB_MsgLog.Id));
return Get<RB_MsgLog>(builder.ToString()).ToList();
}
......
......@@ -37,62 +37,6 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult GetStudentBackClassPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Student_BackClass_ViewModel()
{
ClassName = base.ParmJObj.GetStringValue("ClassName"),
//QStartTime=base.ParmJObj.GetStringValue("QStartTime"),
//QEndTime=base.ParmJObj.GetStringValue("QEndTime"),
AuditStatus=(BackClassAuditStatusEnum)base.ParmJObj.GetInt("AuditStatus"),
};
query.CreateBy = base.UserInfo.Id;
//var Conditon = base.ParmJObj.GetInt("Conditon");
//if (Conditon > 0)
//{
// query.Conditon = (BackClassConditionEnum)Conditon;
//}
//query.Group_Id = base.UserInfo.Group_Id;
//List<object> result = new List<object>();
//var list = studentBillModule.GetStudentBackClassPageListModule(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.EnterID > 0)
// {
// item.EnterName = UserReidsCache.GetUserLoginInfo(item.EnterID)?.AccountName ?? "";
// }
// result.Add(new
// {
// item.BackId,
// item.BackNum,
// item.GuestId,
// item.GuestName,
// item.SchoolId,
// item.SchoolName,
// item.ClassId,
// item.ClassName,
// item.TeacherId,
// item.TeacherName,
// item.FinishHours,
// item.BackMoney,
// item.CreateTimeStr,
// item.CreateByName,
// item.AuditStatus,
// item.EnterID,
// item.EnterName,
// item.CourseName,
// item.ApplyReason,
// item.OrderId,
// AuditStatusName=item.AuditStatus.ToName(),
// item.SpecialNode,
// item.RealityBackMoney,
// item.FinanceId,
// });
//}
//pageModel.Count = rowsCount;
//pageModel.PageData = result;
return ApiResult.Success(data: pageModel);
}
......
......@@ -63,7 +63,8 @@ namespace Edu.WebApi.Controllers.EduTask
}
foreach (var item in model.OldChangePlanItemList)
{
if (item.PlanTimeList.Count() != model.NewChangePlanItemList.Where(x => x.ClassDate == item.ClassDate).Count())
var newChangePlanModel = model.NewChangePlanItemList.Where(x => x.ClassPlanId == item.ClassPlanId).FirstOrDefault();
if (item.PlanTimeList.Count() != newChangePlanModel.PlanTimeList.Count())
{
return ApiResult.Failed(item.ClassDate.ToString("yyyy-MM-dd") + "号的排课原课时数与现有课时数不一致");
}
......@@ -98,5 +99,16 @@ namespace Edu.WebApi.Controllers.EduTask
bool flag = changeClassPlanModule.SetChangeClassPlanModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
public ApiResult TestUpdateClassPlan()
{
int id = base.ParmJObj.GetInt("Id");
var result = changeClassPlanModule.UpdateChangeClassPlan(id);
return ApiResult.Success("");
}
}
}
......@@ -64,6 +64,29 @@ namespace Edu.WebApi.Controllers.EduTask
return ApiResult.Success(data: Info);
}
/// <summary>
/// 教务单据审核
/// </summary>
/// <param name="model">审核信息</param>
/// <param name="user">登录用户信息</param>
/// <param name="message">返回提示信息</param>
/// <returns></returns>
public ApiResult AduitEducationReceipt()
{
var auditModel = new EduReceiptAudit()
{
Id = base.ParmJObj.GetInt("Id"),
AuditStatus = base.ParmJObj.GetInt("AuditStatus"),
BackMoney = base.ParmJObj.GetDecimal("BackMoney"),
Description = base.ParmJObj.GetStringValue("Description"),
RecipientIds = base.ParmJObj.GetStringValue("RecipientIds"),
SpecialNode = base.ParmJObj.GetInt("SpecialNode"),
};
var flag = educationReceiptModule.AduitEducationReceiptModule(auditModel, base.UserInfo, out string message);
return flag?ApiResult.Success():ApiResult.Failed(message: message);
}
/// <summary>
/// 获取单据类型
/// </summary>
......@@ -75,6 +98,4 @@ namespace Edu.WebApi.Controllers.EduTask
return ApiResult.Success(data: list);
}
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Edu.Common.API;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Flow;
using Edu.Module.System;
......@@ -10,6 +11,7 @@ using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace Edu.WebApi.Controllers.Public
{
......@@ -58,6 +60,38 @@ namespace Edu.WebApi.Controllers.Public
UpdateBy = base.UserInfo.Id,
UpdateTime = DateTime.Now,
};
extModel.FlowNodeList = new List<RB_Flow_Node_ViewModel>();
JArray jArray = JArray.Parse(base.ParmJObj.GetStringValue("FlowNodeList"));
foreach (var jItem in jArray)
{
JObject jObj = JObject.Parse(jItem.ToString());
RB_Flow_Node_ViewModel model = new RB_Flow_Node_ViewModel()
{
FlowId=jObj.GetInt("FlowId"),
NodeId=jObj.GetInt("NodeId"),
NodeName=jObj.GetStringValue("NodeName"),
SortNum=jObj.GetInt("SortNum"),
};
model.FlowAduitList = new List<RB_Flow_AduitInfo_ViewModel>();
//审核人数组
JArray subArray= JArray.Parse(jObj.GetStringValue("FlowAduitList"));
foreach (var sItem in subArray)
{
JObject sObj = JObject.Parse(sItem.ToString());
model.FlowAduitList.Add(new RB_Flow_AduitInfo_ViewModel()
{
CheckId = sObj.GetInt("CheckId"),
NodeId=sObj.GetInt("NodeId"),
FlowId=sObj.GetInt("FlowId"),
AduitName=sObj.GetStringValue("AduitName"),
AuditType=(WFTAuditTypeEnum)sObj.GetInt("AuditType"),
UserId=sObj.GetInt("UserId"),
IsSpecNode=sObj.GetInt("IsSpecNode"),
PostType=sObj.GetInt("PostType"),
AuditWay=(WFTAuditWayEnum)sObj.GetInt("AuditWay"),
});
}
}
if (!string.IsNullOrEmpty(base.ParmJObj.GetStringValue("FlowNodeList")))
{
try
......
......@@ -78,5 +78,7 @@
//连续缺课课时
"AbsentHours": 12,
//值班时间验证日期
"DutyDate": "2021-06-30"
"DutyDate": "2021-06-30",
//调课流程编号
"ChangeClassFlowId": 2
}
\ 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