Commit 1f0c33ed authored by 黄奎's avatar 黄奎

页面

parent ae48adfc
......@@ -25,7 +25,7 @@ namespace Edu.Model.Entity.EduTask
public int CourseId { get; set; }
/// <summary>
/// 调动类型(1-课程,2-老师,3-教室)
/// 调动类型(1-课程,2-老师,3-教室,4-取消课程)
/// </summary>
public int ChangeType { get; set; }
......
......@@ -114,6 +114,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string OpenTimeStr { get; set; }
/// <summary>
/// 预计完成时间
/// </summary>
public string FinishTimeStr { get; set; }
/// <summary>
/// 开班开始时间
/// </summary>
......
......@@ -263,12 +263,17 @@ namespace Edu.Module.Course
var classOrderList = new List<RB_Order_ViewModel>();
var stepPriceList = new List<RB_Class_StepPrice_ViewModel>();
var otherCourseList = new List<RB_Class_Course_Extend>();
var maxPlanDateList = new List<RB_Class_Plan_ViewModel>();
string ids = string.Join(",", list.Select(qitem => qitem.ClassId));
if (!string.IsNullOrEmpty(ids))
{
classTimeList = class_TimeRepository.GetClassTimeListRepository(ids);
classOrderList = orderRepository.GetClassOrderPeopleNumRepository(ids);
otherCourseList = GetClassCourseListModule(new RB_Class_Course_Extend() { QClassIds = ids });
maxPlanDateList= class_PlanRepository.GetClassPlanMaxDataRepository(new RB_Class_Plan_ViewModel()
{
QClassIds = ids
});
}
if (isGetStepPrice)
{
......@@ -278,6 +283,8 @@ namespace Edu.Module.Course
//课程计划上课日期
foreach (var item in list)
{
var finish = maxPlanDateList?.Where(qitem => qitem.ClassId == item.ClassId)?.FirstOrDefault()?.ClassDate;
item.FinishTimeStr = Common.ConvertHelper.FormatDate(finish);
item.NewPlanDateTime = classTimeList?.Where(qitem => qitem.ClassId == item.ClassId)?.FirstOrDefault()?.NewPlanDateTime;
item.OrderStudentCount = classOrderList?.Where(qitem => qitem.ClassId == item.ClassId)?.FirstOrDefault()?.GuestNum ?? 0;
if (isGetStepPrice)
......
using Edu.Model.ViewModel.EduTask;
using Edu.Model.Entity.EduTask;
using Edu.Model.ViewModel.EduTask;
using Edu.Repository.EduTask;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.AOP.CustomerAttribute;
using VT.FW.DB;
namespace Edu.Module.EduTask
......@@ -12,6 +14,11 @@ namespace Edu.Module.EduTask
/// </summary>
public class ChangeClassPlanModule
{
/// <summary>
/// 教务单据仓储层对象
/// </summary>
private readonly RB_Education_ReceiptRepository education_ReceiptRepository = new RB_Education_ReceiptRepository();
/// <summary>
/// 调课计划仓储层对象
/// </summary>
......@@ -32,7 +39,8 @@ namespace Edu.Module.EduTask
/// 新增修改调课计划
/// </summary>
/// <returns></returns>
public bool SetChangeClassPlanModule(RB_Change_ClassPlan_ViewModel extModel)
[TransactionCallHandler]
public virtual bool SetChangeClassPlanModule(RB_Change_ClassPlan_ViewModel extModel)
{
bool flag = false;
if (extModel.Id > 0)
......@@ -53,6 +61,24 @@ namespace Edu.Module.EduTask
var newId = change_ClassPlanRepository.Insert(extModel);
extModel.Id = newId;
flag = newId > 0;
if (flag)
{
var educationReceipt = new RB_Education_Receipt()
{
Id=0,
Title="调课申请",
ReceiptType= Common.Enum.Finance.ReceiptTypeEnum.ChangeClass,
RelationId=newId,
Group_Id=extModel.Group_Id,
School_Id=extModel.School_Id,
CreateBy=extModel.CreateBy,
CreateTime=extModel.CreateTime,
UpdateBy=extModel.UpdateBy,
UpdateTime=extModel.UpdateTime,
VerifyStatus= Common.Enum.Finance.WFRrocessStatus.NotAudit
};
flag= education_ReceiptRepository.SetEducationReceiptRepository(educationReceipt);
}
}
return flag;
}
......
......@@ -289,6 +289,37 @@ where a.`Status`=0 and c.ClassStatus=2 and c.`Status`=0");
return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 获取班级最后一次上课日期
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_Plan_ViewModel> GetClassPlanMaxDataRepository(RB_Class_Plan_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.ClassId,MAX(A.ClassDate) AS ClassDate
FROM rb_class_plan AS A
WHERE 1=1 ");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.Group_Id), query.Group_Id);
}
if (query.ClassId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.ClassId), query.ClassId);
}
if (!string.IsNullOrEmpty(query.QClassIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Class_Plan_ViewModel.ClassId), query.QClassIds);
}
}
return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
......
......@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Text;
using System.Linq;
using VT.FW.DB.Dapper;
using VT.FW.DB;
namespace Edu.Repository.EduTask
{
......@@ -44,5 +45,32 @@ WHERE 1=1
}
return GetPage<RB_Education_Receipt_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 新增修改教务单据
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetEducationReceiptRepository(RB_Education_Receipt model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Education_Receipt.UpdateBy),model.UpdateBy },
{nameof(RB_Education_Receipt.UpdateTime),model.UpdateTime },
};
flag = base.Update(fileds, new WhereHelper(nameof(RB_Education_Receipt.Id),model.Id));
}
else
{
var newId = base.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
}
}
......@@ -67,6 +67,7 @@ namespace Edu.WebApi.Controllers.Course
item.ClassName,
item.School_Id,
item.SchoolName,
item.CouseId,
item.CourseName,
item.Teacher_Id,
item.TeacherName,
......@@ -79,7 +80,8 @@ namespace Edu.WebApi.Controllers.Course
item.ClassStatus,
item.Status,
item.OtherCourseList,
item.ClassNo
item.ClassNo,
item.FinishTimeStr
});
}
pageModel.Count = rowsCount;
......
......@@ -69,6 +69,7 @@ namespace Edu.WebApi.Controllers.Course
x.ClassName,
x.ClassNo,
x.CourseName,
x.CouseId,
x.CourseFeature,
x.ClassHours,
x.TeacherName,
......
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.EduTask;
using Edu.Module.EduTask;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.EduTask
{
/// <summary>
/// 改变流程相关申请
/// </summary>
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class ChangePlanController : BaseController
{
/// <summary>
/// 调课处理类对象
/// </summary>
private readonly ChangeClassPlanModule changeClassPlanModule = AOP.AOPHelper.CreateAOPObject<ChangeClassPlanModule>();
/// <summary>
/// 新增修改班级调课
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetChangeClassPlan()
{
var model = new RB_Change_ClassPlan_ViewModel()
{
Id=base.ParmJObj.GetInt("Id"),
ClassId=base.ParmJObj.GetInt("ClassId"),
CourseId=base.ParmJObj.GetInt("CourseId"),
ChangeType=base.ParmJObj.GetInt("ChangeType"),
MoveType=base.ParmJObj.GetInt("MoveType"),
SourceData=base.ParmJObj.GetStringValue("SourceData"),
TargetData=base.ParmJObj.GetStringValue("TargetData"),
};
model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id;
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateBy = base.UserInfo.Id;
model.UpdateTime = DateTime.Now;
bool flag = changeClassPlanModule.SetChangeClassPlanModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
}
}
using Edu.Common.API;
using Edu.Model.ViewModel.EduTask;
using Edu.Module.EduTask;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.EduTask
{
/// <summary>
/// 流程设置相关接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class EducationReceiptController : BaseController
{
/// <summary>
/// 教务单据处理类对象
/// </summary>
private readonly EducationReceiptModule educationReceiptModule = AOP.AOPHelper.CreateAOPObject<EducationReceiptModule>();
/// <summary>
/// 获取教务单据分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEducationReceiptPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new EducationReceiptQuery()
{
Group_Id = base.UserInfo.Group_Id,
};
var list = educationReceiptModule.GetEducationReceiptPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
}
}
......@@ -72,5 +72,50 @@ namespace Edu.WebApi.Controllers.Public
var flag = basicFlowModule.SetFlowModule(extModel);
return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
}
/// <summary>
/// 获取调课流程
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetChangeClassFlow()
{
var FlowId = base.ParmJObj.GetInt("FlowId");
var flowModel = basicFlowModule.GetFlowModule(FlowId);
return ApiResult.Success(data: flowModel);
}
/// <summary>
/// 新增修改调课流程
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetChangeClassFlow()
{
var extModel = new RB_Flow_ViewModel()
{
FlowId = base.ParmJObj.GetInt("FlowId"),
FlowName = base.ParmJObj.GetStringValue("FlowName"),
Group_Id = base.UserInfo.Group_Id,
CreateBy = base.UserInfo.Id,
CreateTime = DateTime.Now,
Status = Common.Enum.DateStateEnum.Normal,
UpdateBy = base.UserInfo.Id,
UpdateTime = DateTime.Now,
};
if (!string.IsNullOrEmpty(base.ParmJObj.GetStringValue("FlowNodeList")))
{
try
{
extModel.FlowNodeList = Common.Plugin.JsonHelper.DeserializeObject<List<RB_Flow_Node_ViewModel>>(base.ParmJObj.GetStringValue("FlowNodeList"));
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetChangeClassFlow_FlowNodeList");
}
}
var flag = basicFlowModule.SetFlowModule(extModel);
return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
}
}
}
......@@ -40,6 +40,7 @@
<ProjectReference Include="..\Edu.Module.Advertising\Edu.Module.Advertising.csproj" />
<ProjectReference Include="..\Edu.Module.Course\Edu.Module.Course.csproj" />
<ProjectReference Include="..\Edu.Module.Duty\Edu.Module.Duty.csproj" />
<ProjectReference Include="..\Edu.Module.EduTask\Edu.Module.EduTask.csproj" />
<ProjectReference Include="..\Edu.Module.Finance\Edu.Module.Finance.csproj" />
<ProjectReference Include="..\Edu.Module.OKR\Edu.Module.OKR.csproj" />
<ProjectReference Include="..\Edu.Module.Public\Edu.Module.Public.csproj" />
......
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