Commit 4c353274 authored by 黄奎's avatar 黄奎

新增字段

parent 6ada2c23
...@@ -29,5 +29,29 @@ namespace Edu.Model.ViewModel.Duty ...@@ -29,5 +29,29 @@ namespace Edu.Model.ViewModel.Duty
/// 值班人员名称 /// 值班人员名称
/// </summary> /// </summary>
public string EmployeeName { get; set; } public string EmployeeName { get; set; }
/// <summary>
/// 抄送人员
/// </summary>
public string SendName { get; set; }
/// <summary>
/// 管理员列表
/// </summary>
public List<int> EmployeeIdList
{
get
{
return Common.ConvertHelper.StringToList(this.EmployeeIds);
}
}
/// <summary>
/// 抄送人员列表
/// </summary>
public List<int> SendEmployeeIdList
{
get { return Common.ConvertHelper.StringToList(this.SendEmployeeIds); }
}
} }
} }
...@@ -2,15 +2,30 @@ ...@@ -2,15 +2,30 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Edu.Model.ViewModel.Duty; using Edu.Model.ViewModel.Duty;
using Edu.Model.ViewModel.User;
using Edu.Repository.Duty; using Edu.Repository.Duty;
using VT.FW.DB; using VT.FW.DB;
namespace Edu.Module.Duty namespace Edu.Module.Duty
{ {
/// <summary>
/// 值班配置处理类
/// </summary>
public class DutyModule public class DutyModule
{ {
/// <summary>
/// 值班设置配置仓储对象
/// </summary>
private readonly RB_Duty_ConfigRepository dutyConfigRepository = new RB_Duty_ConfigRepository(); private readonly RB_Duty_ConfigRepository dutyConfigRepository = new RB_Duty_ConfigRepository();
/// <summary>
/// 班次仓储层对象
/// </summary>
private readonly RB_Duty_FrequencyRepository dutyFrequencyRepository = new RB_Duty_FrequencyRepository(); private readonly RB_Duty_FrequencyRepository dutyFrequencyRepository = new RB_Duty_FrequencyRepository();
/// <summary>
/// 值班事项仓储层对象
/// </summary>
private readonly RB_Duty_ItemRepository dutyItemRepository = new RB_Duty_ItemRepository(); private readonly RB_Duty_ItemRepository dutyItemRepository = new RB_Duty_ItemRepository();
/// <summary> /// <summary>
...@@ -98,16 +113,32 @@ namespace Edu.Module.Duty ...@@ -98,16 +113,32 @@ namespace Edu.Module.Duty
if (list != null && list.Any()) if (list != null && list.Any())
{ {
string uids = string.Join(",", list.Select(x => x.EmployeeIds)); string uids = string.Join(",", list.Select(x => x.EmployeeIds));
var userList = accountRepository.GetEmployeeListRepository(new Model.ViewModel.User.Employee_ViewModel { Group_Id = query.Group_Id, QIds = uids }); string sendIds = string.Join(",", list.Select(x => x.SendEmployeeIds));
List<int> userIdList = new List<int>();
userIdList.AddRange(Common.ConvertHelper.StringToList(uids));
userIdList.AddRange(Common.ConvertHelper.StringToList(sendIds));
var userList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel { Group_Id = query.Group_Id, QIds = string.Join(",", userIdList) });
foreach (var item in list) foreach (var item in list)
{ {
string userNames = ""; string userNames = "";
foreach (var itemUser in item.EmployeeIds.Split(",")) string sendNames = "";
if (!string.IsNullOrEmpty(item.EmployeeIds))
{
foreach (var itemUser in item.EmployeeIds.Split(","))
{
userNames += userList.Where(x => x.Id.ToString() == itemUser).FirstOrDefault()?.EmployeeName + "|";
}
}
if (!string.IsNullOrEmpty(item.SendEmployeeIds))
{ {
userNames += userList.Where(x => x.Id.ToString() == itemUser).FirstOrDefault()?.EmployeeName + "|"; foreach (var sUser in item.SendEmployeeIds.Split(","))
{
sendNames += userList.Where(x => x.Id.ToString() == sUser).FirstOrDefault()?.EmployeeName + "|";
}
} }
item.EmployeeName = userNames.TrimEnd('|'); item.EmployeeName = userNames.TrimEnd('|');
item.SendName = sendNames.TrimEnd('|');
} }
} }
return list; return list;
...@@ -174,7 +205,7 @@ namespace Edu.Module.Duty ...@@ -174,7 +205,7 @@ namespace Edu.Module.Duty
/// <returns></returns> /// <returns></returns>
public List<RB_Duty_Frequency_ViewModel> GetDutyFrequencyModule(RB_Duty_Frequency_ViewModel query) public List<RB_Duty_Frequency_ViewModel> GetDutyFrequencyModule(RB_Duty_Frequency_ViewModel query)
{ {
return dutyFrequencyRepository.GetDutyFrequencyRepository(query); return dutyFrequencyRepository.GetDutyFrequencyRepository(query);
} }
/// <summary> /// <summary>
......
...@@ -9,7 +9,7 @@ using VT.FW.DB.Dapper; ...@@ -9,7 +9,7 @@ using VT.FW.DB.Dapper;
namespace Edu.Repository.Duty namespace Edu.Repository.Duty
{ {
/// <summary> /// <summary>
/// 值班设置配置仓储 /// 值班设置配置仓储
/// </summary> /// </summary>
public class RB_Duty_ConfigRepository:BaseRepository<RB_Duty_Config> public class RB_Duty_ConfigRepository:BaseRepository<RB_Duty_Config>
{ {
......
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Edu.Model.Entity.Duty; using Edu.Model.Entity.Duty;
using Edu.Model.ViewModel.Duty; using Edu.Model.ViewModel.Duty;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Duty namespace Edu.Repository.Duty
{ {
/// <summary>
/// 班次仓储层
/// </summary>
public class RB_Duty_FrequencyRepository : BaseRepository<RB_Duty_Frequency> public class RB_Duty_FrequencyRepository : BaseRepository<RB_Duty_Frequency>
{ {
/// <summary> /// <summary>
......
...@@ -16,7 +16,7 @@ namespace Edu.Repository.Duty ...@@ -16,7 +16,7 @@ namespace Edu.Repository.Duty
/// </summary> /// </summary>
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Duty_Item_ViewModel> GetDutyItemRepository(RB_Duty_Item_ViewModel query) public List<RB_Duty_Item_ViewModel> GetDutyItemListExtRepository(RB_Duty_Item_ViewModel query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
......
...@@ -377,6 +377,7 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -377,6 +377,7 @@ namespace Edu.WebApi.Controllers.Duty
Shifts = base.ParmJObj.GetStringValue("Shifts"), Shifts = base.ParmJObj.GetStringValue("Shifts"),
Group_Id = base.UserInfo.Group_Id, Group_Id = base.UserInfo.Group_Id,
Id = base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
SendEmployeeIds=base.ParmJObj.GetStringValue("SendEmployeeIds"),
}; };
if (string.IsNullOrWhiteSpace(query.EmployeeIds)) if (string.IsNullOrWhiteSpace(query.EmployeeIds))
{ {
......
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