Commit ef2cc1d2 authored by 黄奎's avatar 黄奎

页面修改

parent d5381513
...@@ -39,7 +39,7 @@ namespace Edu.Common ...@@ -39,7 +39,7 @@ namespace Edu.Common
/// </summary> /// </summary>
/// <param name="time"></param> /// <param name="time"></param>
/// <returns></returns> /// <returns></returns>
public static string FormatDate(object time) public static string FormatDate(this object time)
{ {
string timeStr = ""; string timeStr = "";
if (time != null) if (time != null)
......
...@@ -29,6 +29,17 @@ namespace Edu.Model.ViewModel.User ...@@ -29,6 +29,17 @@ namespace Edu.Model.ViewModel.User
/// </summary> /// </summary>
public string UpdateTimeStr { get { return this.UpdateTime.FormatTime(); } } public string UpdateTimeStr { get { return this.UpdateTime.FormatTime(); } }
/// <summary>
/// 出生日期字符串
/// </summary>
public string StuBirthStr
{
get
{
return this.StuBirth.FormatDate();
}
}
/// <summary> /// <summary>
/// 禁用、启用字符串 /// 禁用、启用字符串
/// </summary> /// </summary>
...@@ -49,5 +60,10 @@ namespace Edu.Model.ViewModel.User ...@@ -49,5 +60,10 @@ namespace Edu.Model.ViewModel.User
/// 所属校区 /// 所属校区
/// </summary> /// </summary>
public string SName { get; set; } public string SName { get; set; }
/// <summary>
/// 地区名称【省/市/区县】
/// </summary>
public string AreaName { get; set; }
} }
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ namespace Edu.Module.System ...@@ -19,7 +19,7 @@ namespace Edu.Module.System
/// 省市区树形列表 /// 省市区树形列表
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public List<AreaTree_ViewModel> GetAreaTree() public List<AreaTree_ViewModel> GetAreaTreeModule()
{ {
List<AreaTree_ViewModel> treeList = new List<AreaTree_ViewModel>(); List<AreaTree_ViewModel> treeList = new List<AreaTree_ViewModel>();
var list = destinationRepository.GetDestinationListRepository(new RB_Destination_ViewModel() { }); var list = destinationRepository.GetDestinationListRepository(new RB_Destination_ViewModel() { });
...@@ -72,5 +72,16 @@ namespace Edu.Module.System ...@@ -72,5 +72,16 @@ namespace Edu.Module.System
} }
return treeList; return treeList;
} }
/// <summary>
/// 根据查询条件获取地区列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Destination_ViewModel> GetAreaListModule(RB_Destination_ViewModel query)
{
var list = destinationRepository.GetDestinationListRepository(query);
return list;
}
} }
} }
\ No newline at end of file
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Repository.System;
using Edu.Repository.User; using Edu.Repository.User;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using VT.FW.DB; using VT.FW.DB;
namespace Edu.Module.User namespace Edu.Module.User
...@@ -16,6 +18,11 @@ namespace Edu.Module.User ...@@ -16,6 +18,11 @@ namespace Edu.Module.User
/// </summary> /// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository(); private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 地区仓储层对象
/// </summary>
private readonly RB_DestinationRepository destinationRepository = new RB_DestinationRepository();
/// <summary> /// <summary>
/// 获取学生列表 /// 获取学生列表
/// </summary> /// </summary>
...@@ -36,7 +43,43 @@ namespace Edu.Module.User ...@@ -36,7 +43,43 @@ namespace Edu.Module.User
/// <returns></returns> /// <returns></returns>
public List<RB_Student_ViewModel> GetStudentPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_ViewModel query) public List<RB_Student_ViewModel> GetStudentPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_ViewModel query)
{ {
return studentRepository.GetStudentPageListRepository(pageIndex, pageSize, out rowsCount, query); var list = studentRepository.GetStudentPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
var provideList = list.Where(qitem => qitem.ProviceId > 0).Select(qitem => qitem.ProviceId).ToList();
var cityList = list.Where(qitem => qitem.CityId > 0).Select(qitem => qitem.CityId).ToList();
var areaList = list.Where(qitem => qitem.AreaId > 0).Select(qitem => qitem.AreaId).ToList();
List<int> ids = new List<int>();
if (provideList != null && provideList.Count > 0)
{
ids.AddRange(provideList);
}
if (cityList != null && cityList.Count > 0)
{
ids.AddRange(cityList);
}
if (areaList != null && areaList.Count > 0)
{
ids.AddRange(areaList);
}
string qIds = "";
if (ids != null && ids.Count > 0)
{
qIds = string.Join(",", ids);
}
else
{
qIds = "0";
}
var destinationList = destinationRepository.GetDestinationListRepository(new Model.ViewModel.System.RB_Destination_ViewModel() { Ids = qIds });
foreach (var item in list)
{
item.AreaName = (destinationList?.FirstOrDefault(qitem => qitem.ID == item.ProviceId)?.Name ?? "")
+ "/" + (destinationList?.FirstOrDefault(qitem => qitem.ID == item.CityId)?.Name ?? "")
+ "/" + (destinationList?.FirstOrDefault(qitem => qitem.ID == item.AreaId)?.Name ?? "");
}
}
return list;
} }
/// <summary> /// <summary>
...@@ -103,7 +146,7 @@ namespace Edu.Module.User ...@@ -103,7 +146,7 @@ namespace Edu.Module.User
/// <param name="StuId"></param> /// <param name="StuId"></param>
/// <param name="IsDisable">0-禁用,1-启用</param> /// <param name="IsDisable">0-禁用,1-启用</param>
/// <returns></returns> /// <returns></returns>
public bool UpdateStudentIsDisableModule(object StuId,int IsDisable) public bool UpdateStudentIsDisableModule(object StuId, int IsDisable)
{ {
bool flag; bool flag;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
......
...@@ -43,7 +43,19 @@ namespace Edu.WebApi.Controllers.Public ...@@ -43,7 +43,19 @@ namespace Edu.WebApi.Controllers.Public
[HttpPost] [HttpPost]
public ApiResult GetAreaTree() public ApiResult GetAreaTree()
{ {
var list = destinationModule.GetAreaTree(); var list = destinationModule.GetAreaTreeModule();
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取省市区列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAreaList()
{
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Destination_ViewModel>(RequestParm.Msg.ToString());
var list = destinationModule.GetAreaListModule(query);
return ApiResult.Success(data: list); return ApiResult.Success(data: list);
} }
......
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