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

提交代码

parent 166d1ad2
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.EduTask
{
/// <summary>
/// 上课计划调整实体类
/// </summary>
public class RB_Change_ClassPlan
/// <summary>
/// 上课计划调整实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Change_ClassPlan
{
/// <summary>
/// 主键(调课编号)
......
......@@ -38,6 +38,12 @@ namespace Edu.Module.EduTask
}
public bool UpdateChangeClassPlan(int id) {
return change_ClassPlanRepository.UpdateChangeClassPlan(id);
}
/// <summary>
/// 新增修改调课计划
/// </summary>
......
......@@ -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("");
}
}
}
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