Commit 62d7dd34 authored by 吴春's avatar 吴春

提交代码

parent 166d1ad2
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.EduTask namespace Edu.Model.Entity.EduTask
{ {
/// <summary> /// <summary>
/// 上课计划调整实体类 /// 上课计划调整实体类
/// </summary> /// </summary>
public class RB_Change_ClassPlan [Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Change_ClassPlan
{ {
/// <summary> /// <summary>
/// 主键(调课编号) /// 主键(调课编号)
......
...@@ -38,6 +38,12 @@ namespace Edu.Module.EduTask ...@@ -38,6 +38,12 @@ namespace Edu.Module.EduTask
} }
public bool UpdateChangeClassPlan(int id) {
return change_ClassPlanRepository.UpdateChangeClassPlan(id);
}
/// <summary> /// <summary>
/// 新增修改调课计划 /// 新增修改调课计划
/// </summary> /// </summary>
......
...@@ -63,7 +63,8 @@ namespace Edu.WebApi.Controllers.EduTask ...@@ -63,7 +63,8 @@ namespace Edu.WebApi.Controllers.EduTask
} }
foreach (var item in model.OldChangePlanItemList) 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") + "号的排课原课时数与现有课时数不一致"); return ApiResult.Failed(item.ClassDate.ToString("yyyy-MM-dd") + "号的排课原课时数与现有课时数不一致");
} }
...@@ -98,5 +99,16 @@ namespace Edu.WebApi.Controllers.EduTask ...@@ -98,5 +99,16 @@ namespace Edu.WebApi.Controllers.EduTask
bool flag = changeClassPlanModule.SetChangeClassPlanModule(model); bool flag = changeClassPlanModule.SetChangeClassPlanModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
public ApiResult TestUpdateClassPlan()
{
int id = base.ParmJObj.GetInt("Id");
var result = changeClassPlanModule.UpdateChangeClassPlan(id);
return ApiResult.Success("");
}
} }
} }
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