Commit 7cdf2f51 authored by liudong1993's avatar liudong1993

解决冲突

parents bf4bf393 681fb74b
......@@ -97,5 +97,13 @@ namespace Edu.Model.ViewModel.Course
/// 查询可报名 1是
/// </summary>
public int Q_CanApply { get; set; }
/// 选中的周几/或日期数组
/// </summary>
public List<string> WeekDayList { get; set; }
/// <summary>
/// 默认上课时间
/// </summary>
public List<RB_Class_Time_ViewModel> DefaultPlanTimeList { get; set; }
}
}
\ No newline at end of file
......@@ -34,7 +34,7 @@ namespace Edu.Model.ViewModel.User
public int IsCompany { get; set; }
/// <summary>
/// 数据类型(1-部门,2-员工)
/// 数据类型(1-部门,2-员工,3-岗位)
/// </summary>
public int DataType { get; set; }
......
This diff is collapsed.
......@@ -21,10 +21,11 @@ namespace Edu.Module.User
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 学校仓储层对象
/// 岗位仓储层对象
/// </summary>
private readonly RB_SchoolRepository schoolRepository = new RB_SchoolRepository();
private readonly RB_PostRepository postRepository = new RB_PostRepository();
/// <summary>
/// 获取部门分页列表
......@@ -132,19 +133,24 @@ namespace Edu.Module.User
/// 获取部门结构树
/// </summary>
/// <param name="query"></param>
/// <param name="query">是否查询员工</param>
/// <param name="isQueryEmployee">是否查询员工</param>
/// <param name="isQueryPost">是否岗位</param>
/// <returns></returns>
public List<DepartmentTree_ViewModel> GetDepartmentTreeModule(RB_Department_ViewModel query,bool isQueryEmployee=false)
public List<DepartmentTree_ViewModel> GetDepartmentTreeModule(RB_Department_ViewModel query,bool isQueryEmployee=false,bool isQueryPost=false)
{
//树形结构列表
List<DepartmentTree_ViewModel> list = new List<DepartmentTree_ViewModel>();
//所有的部门列表
var deptList = GetDepartmentListModule(query);
//员工列表
var empList = new List<Employee_ViewModel>();
//岗位列表
var postList = new List<RB_Post_ViewModel>();
if (deptList == null)
{
deptList = new List<RB_Department_ViewModel>();
}
//查询员工
if (isQueryEmployee)
{
empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
......@@ -153,6 +159,13 @@ namespace Edu.Module.User
School_Id = query.School_Id
});
}
if (isQueryPost)
{
postList= postRepository.GetPostListRepository(new RB_Post_ViewModel()
{
Group_Id = query.Group_Id,
});
}
if (deptList != null && deptList.Count > 0)
{
var firstList = new List<RB_Department_ViewModel>();
......@@ -200,7 +213,30 @@ namespace Edu.Module.User
}
}
#endregion
var childList = GetDeptTreeList(fItem.DeptId, deptList, empList: empList);
#region 添加岗位
if (isQueryPost)
{
var tempPostList = postList?.Where(qitem => qitem.RB_Dept_Id == fItem.DeptId)?.ToList();
if (tempPostList != null && tempPostList.Count > 0)
{
foreach (var pItem in tempPostList)
{
tModel.ChildList.Add(new DepartmentTree_ViewModel()
{
DeptId = pItem.PostId,
DeptName = pItem.PostName,
ParentId = 0,
ChildList = new List<DepartmentTree_ViewModel>(),
School_Id = fItem.School_Id,
DataType = 3,
});
}
}
}
#endregion
var childList = GetDeptTreeList(fItem.DeptId, deptList, empList: empList,postList:postList);
if (childList != null && childList.Count > 0)
{
tModel.ChildList.AddRange(childList);
......@@ -219,7 +255,7 @@ namespace Edu.Module.User
/// <param name="parentId">父节点编号</param>
/// <param name="sourceList">数据源列表</param>
/// <param name="empList">员工列表</param>
private List<DepartmentTree_ViewModel> GetDeptTreeList(int parentId, List<RB_Department_ViewModel> sourceList, List<Employee_ViewModel> empList=null)
private List<DepartmentTree_ViewModel> GetDeptTreeList(int parentId, List<RB_Department_ViewModel> sourceList, List<Employee_ViewModel> empList=null, List<RB_Post_ViewModel> postList=null)
{
List<DepartmentTree_ViewModel> treeList = new List<DepartmentTree_ViewModel>();
foreach (var item in sourceList.Where(qitem => qitem.ParentId == parentId))
......@@ -234,6 +270,7 @@ namespace Edu.Module.User
IsCompany = item.IsCompany,
DataType = 1,
};
#region 添加员工信息
if (empList != null && empList.Count > 0)
{
......@@ -255,7 +292,30 @@ namespace Edu.Module.User
}
}
#endregion
var childList= GetDeptTreeList(item.DeptId, sourceList);
#region 添加岗位
if (postList != null && postList.Count > 0)
{
var tempPostList = postList?.Where(qitem => qitem.RB_Dept_Id == item.DeptId)?.ToList();
if (tempPostList != null && tempPostList.Count > 0)
{
foreach (var pItem in tempPostList)
{
model.ChildList.Add(new DepartmentTree_ViewModel()
{
DeptId = pItem.PostId,
DeptName = pItem.PostName,
ParentId = 0,
ChildList = new List<DepartmentTree_ViewModel>(),
School_Id = item.School_Id,
DataType = 3,
});
}
}
}
#endregion
var childList = GetDeptTreeList(item.DeptId, sourceList, empList: empList, postList: postList);
if (childList != null && childList.Count > 0)
{
model.ChildList.AddRange(childList);
......
......@@ -3,6 +3,7 @@ using Edu.Model.ViewModel.Course;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB;
namespace Edu.Repository.Course
{
......@@ -38,6 +39,21 @@ WHERE 1=1
return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 判断是否存在
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool CheckExistsRepository(RB_Class_Plan_ViewModel model)
{
List<WhereHelper> list = new List<WhereHelper>()
{
new WhereHelper (nameof(RB_Class_Plan_ViewModel.ClassId),model.ClassId),
new WhereHelper (nameof(RB_Class_Plan_ViewModel.ClassDate),model.ClassDate),
};
return base.Exists(list);
}
/// <summary>
/// 根据班级编号删除班级上课计划
/// </summary>
......
......@@ -97,6 +97,7 @@ namespace Edu.WebApi.Controllers.Course
{
var extModel = new RB_Class_ViewModel()
{
ClassId=base.ParmJObj.GetInt("ClassId"),
CreateBy = UserInfo.Id,
CreateTime = DateTime.Now,
UpdateBy = UserInfo.Id,
......@@ -124,6 +125,42 @@ namespace Edu.WebApi.Controllers.Course
CompleteProgress=base.ParmJObj.GetInt("CompleteProgress"),
School_Id=base.ParmJObj.GetInt("School_Id"),
};
try
{
string ClassStepPriceListStr=base.ParmJObj.GetStringValue("ClassStepPriceList");
if (!string.IsNullOrEmpty(ClassStepPriceListStr))
{
extModel.ClassStepPriceList = Common.Plugin.JsonHelper.DeserializeObject<List<RB_Class_StepPrice_ViewModel>>(ClassStepPriceListStr);
}
}
catch(Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetClass_ClassStepPriceList");
}
try
{
string WeekDayListStr = base.ParmJObj.GetStringValue("WeekDayList");
if (!string.IsNullOrEmpty(WeekDayListStr))
{
extModel.WeekDayList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(WeekDayListStr);
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetClass_WeekDayList");
}
try
{
string DefaultPlanTimeListStr = base.ParmJObj.GetStringValue("DefaultPlanTimeList");
if (!string.IsNullOrEmpty(DefaultPlanTimeListStr))
{
extModel.DefaultPlanTimeList = Common.Plugin.JsonHelper.DeserializeObject<List<RB_Class_Time_ViewModel>>(DefaultPlanTimeListStr);
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetClass_DefaultPlanTimeList");
}
bool flag = classModule.SetClassModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......
......@@ -912,6 +912,22 @@ namespace Edu.WebApi.Controllers.User
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取部门岗位树形列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetDeptPostTree()
{
var query = new RB_Department_ViewModel()
{
Group_Id = base.UserInfo.Group_Id,
School_Id = base.ParmJObj.GetInt("School_Id")
};
var list = departmentModule.GetDepartmentTreeModule(query,isQueryPost:true);
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取组织机构图
/// </summary>
......
......@@ -39,6 +39,7 @@ namespace Edu.WebApi
"http://localhost:8400",
"http://localhost:8081",
"http://localhost:8080",
"http://localhost:8181",
"http://localhost:8082",
"http://127.0.0.1:50512",
"http://127.0.0.1:20224",
......
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