Commit 6faf3538 authored by 黄奎's avatar 黄奎

页面修改

parent 33be192d
...@@ -9,6 +9,9 @@ namespace Edu.Model.ViewModel.User ...@@ -9,6 +9,9 @@ namespace Edu.Model.ViewModel.User
[Serializable] [Serializable]
public class RB_Dictvalue_Extend : RB_Dictvalue public class RB_Dictvalue_Extend : RB_Dictvalue
{ {
/// <summary>
/// ֵKey
/// </summary>
public string QDictKeys { get; set; }
} }
} }
\ No newline at end of file
...@@ -799,82 +799,80 @@ namespace Edu.Module.Customer ...@@ -799,82 +799,80 @@ namespace Edu.Module.Customer
return student_AssistRepository.Exists(list); return student_AssistRepository.Exists(list);
} }
/// <summary>
/// 推送课程顾问
/// </summary>
/// <param name="studIds"></param>
/// <param name="uid"></param>
/// <returns></returns>
public (bool result, string msg) SetStudentAssistBatchModule(string studIds,int uid) public (bool result, string msg) SetStudentAssistBatchModule(string studIds,int uid)
{ {
var tempList = studIds.Split(',', StringSplitOptions.RemoveEmptyEntries); //语培推送配置
var pushKey = "PUSH_STU_UNION_EMP"; var pushKey = "PUSH_STU_UNION_EMP";
var pushRule = "PUSH_STU_RULETYPE"; var pushRule = "PUSH_STU_RULETYPE";
if (tempList.Length > 0) //留学就业类推送配置
string studyabroad = "PUSH_STU_STUDYABROAD";
//配置列表
var dicList = dictvalueRepository.GetList(new RB_Dictvalue_Extend()
{
QDictKeys = string.Format("'{0}','{1}','{2}'", pushKey, pushRule, studyabroad)
});
var stuList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { StuIds = studIds });
var push = dicList.Where(qitem => qitem.DictKey == pushKey).FirstOrDefault();
var rule = dicList.Where(qitem => qitem.DictKey == pushRule).FirstOrDefault();
var study= dicList.Where(qitem => qitem.DictKey == studyabroad).FirstOrDefault();
var mask = string.Empty;
if (stuList != null && stuList.Count > 0)
{ {
var push = dictvalueRepository.GetList(new RB_Dictvalue_Extend() { DictKey = pushKey }).FirstOrDefault(); foreach (var item in stuList)
var rule = dictvalueRepository.GetList(new RB_Dictvalue_Extend() { DictKey = pushRule }).FirstOrDefault();
var guwen = push.Content.Split(',', StringSplitOptions.RemoveEmptyEntries);
var guwenName = push.Mask.Split(',', StringSplitOptions.RemoveEmptyEntries);
if (guwen.Length > 1)
{ {
if (rule.Content.Equals("1")) var model = new RB_Student_Assist_Extend()
{ {
var mask = string.Empty; Id = 0,
tempList.ToList().ForEach(x => AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser,
{ StuId = item.StuId,
Random ran = new Random(); Status = Common.Enum.DateStateEnum.Normal
var cur = ran.Next(0, guwen.Length - 1); };
var model = new RB_Student_Assist_Extend() //留学就业分配
{ if (study.Code.Contains(item.StuNeeds.ToString()))
Id = 0, {
AssistId = int.Parse(guwen[cur]), model.AssistId = int.Parse(study.Content);
AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser, SetStudentAssistModule(item.StuId, model, uid);
StuId = int.Parse(x), mask += mask.Contains("," + study.Mask) ? "" : "," + study.Mask;
Status = Common.Enum.DateStateEnum.Normal
};
SetStudentAssistModule(int.Parse(x), model, uid);
mask += mask.Contains("," + guwenName[cur]) ? "" : "," + guwenName[cur];
});
return (true, "学员批量转课程顾问成功,已分别转给顾问:" + mask);
} }
//语培客户分配规则
else else
{ {
var mask = string.Empty; var guwen = push.Content.Split(',', StringSplitOptions.RemoveEmptyEntries);
tempList.ToList().ForEach(x => var guwenName = push.Mask.Split(',', StringSplitOptions.RemoveEmptyEntries);
if (guwen.Length > 1)
{ {
var cache = CustomerRedisCache.Get(); if (rule.Content.Equals("1"))
if (cache >= guwen.Length)
{ {
CustomerRedisCache.Set(1); Random ran = new Random();
cache = 0; var cur = ran.Next(0, guwen.Length - 1);
model.AssistId = int.Parse(guwen[cur]);
SetStudentAssistModule(item.StuId, model, uid);
mask += mask.Contains("," + guwenName[cur]) ? "" : "," + guwenName[cur];
} }
var model = new RB_Student_Assist_Extend() else
{ {
Id = 0, var cache = CustomerRedisCache.Get();
AssistId = int.Parse(guwen[cache]), if (cache >= guwen.Length)
AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser, {
StuId = int.Parse(x), CustomerRedisCache.Set(1);
Status = Common.Enum.DateStateEnum.Normal cache = 0;
}; }
SetStudentAssistModule(int.Parse(x), model, uid); model.AssistId = int.Parse(guwen[cache]);
mask += mask.Contains("," + guwenName[cache]) ? "" : "," + guwenName[cache]; SetStudentAssistModule(item.StuId, model, uid);
}); mask += mask.Contains("," + guwenName[cache]) ? "" : "," + guwenName[cache];
return (true, "学员批量转课程顾问成功,已分别转给顾问:" + mask); }
}
} }
} }
else return (true, "学员批量转课程顾问成功,已分别转给顾问:" + mask);
{
tempList.ToList().ForEach(x =>
{
var model = new RB_Student_Assist_Extend()
{
Id = 0,
AssistId = int.Parse(guwen[0]),
AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser,
StuId = int.Parse(x),
Status = Common.Enum.DateStateEnum.Normal
};
SetStudentAssistModule(int.Parse(x), model, uid);
});
return (true, "学员批量转课程顾问成功,已全部转给顾问:" + push.Mask);
}
} }
else else
{ {
return (false, "未获取到学员信息"); return (false, "未获取到学员信息");
} }
......
...@@ -66,6 +66,11 @@ namespace Edu.Module.User ...@@ -66,6 +66,11 @@ namespace Edu.Module.User
return dictvalueRepository.Update(fileds, new WhereHelper(nameof(RB_Dictvalue_Extend.DictKey), Edu.Common.Config.Notice_BaseKey)); return dictvalueRepository.Update(fileds, new WhereHelper(nameof(RB_Dictvalue_Extend.DictKey), Edu.Common.Config.Notice_BaseKey));
} }
/// <summary>
/// 新增修改客户分配规则
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public (int saveType,bool result,int id) SaveDictModule(RB_Dictvalue model) public (int saveType,bool result,int id) SaveDictModule(RB_Dictvalue model)
{ {
if (model.ID > 0) if (model.ID > 0)
...@@ -73,7 +78,8 @@ namespace Edu.Module.User ...@@ -73,7 +78,8 @@ namespace Edu.Module.User
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{nameof(RB_Dictvalue_Extend.Content),model.Content }, {nameof(RB_Dictvalue_Extend.Content),model.Content },
{nameof(RB_Dictvalue_Extend.Mask),model.Mask } {nameof(RB_Dictvalue_Extend.Mask),model.Mask },
{nameof(RB_Dictvalue_Extend.Code),model.Code },
}; };
var result = dictvalueRepository.Update(fileds, new WhereHelper(nameof(RB_Dictvalue_Extend.DictKey), model.DictKey)); var result = dictvalueRepository.Update(fileds, new WhereHelper(nameof(RB_Dictvalue_Extend.DictKey), model.DictKey));
return (1, result, model.ID); return (1, result, model.ID);
......
...@@ -78,6 +78,10 @@ namespace Edu.Repository.User ...@@ -78,6 +78,10 @@ namespace Edu.Repository.User
{ {
sb.AppendFormat(" AND {0}='{1}' ", nameof(RB_Dictvalue_Extend.DictKey), where.DictKey.Trim()); sb.AppendFormat(" AND {0}='{1}' ", nameof(RB_Dictvalue_Extend.DictKey), where.DictKey.Trim());
} }
if (!string.IsNullOrEmpty(where.QDictKeys))
{
sb.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Dictvalue_Extend.DictKey), where.QDictKeys.Trim());
}
} }
return Get<RB_Dictvalue_Extend>(sb.ToString()).ToList(); return Get<RB_Dictvalue_Extend>(sb.ToString()).ToList();
} }
......
...@@ -934,13 +934,10 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -934,13 +934,10 @@ namespace Edu.WebApi.Controllers.Customer
List<object> list = new List<object>(); List<object> list = new List<object>();
foreach (var item in data) foreach (var item in data)
{ {
string CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
list.Add(new list.Add(new
{ {
item.Id, item.Id,
item.Name, item.Name,
CreateByName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
}); });
} }
return ApiResult.Success(data: list); return ApiResult.Success(data: list);
......
...@@ -143,7 +143,15 @@ namespace Edu.WebApi.Controllers.User ...@@ -143,7 +143,15 @@ namespace Edu.WebApi.Controllers.User
public ApiResult SaveDict() public ApiResult SaveDict()
{ {
UserInfo userInfo = base.UserInfo; UserInfo userInfo = base.UserInfo;
var model = JsonConvert.DeserializeObject<RB_Dictvalue_Extend>(RequestParm.Msg.ToString()); var model = new RB_Dictvalue_Extend()
{
ID = base.ParmJObj.GetInt("ID"),
Code = base.ParmJObj.GetStringValue("Code"),
Content = base.ParmJObj.GetStringValue("Content"),
DictKey = base.ParmJObj.GetStringValue("DictKey"),
Mask = base.ParmJObj.GetStringValue("Mask"),
Name = base.ParmJObj.GetStringValue("Name"),
};
model.RB_Group_id = userInfo.Group_Id; model.RB_Group_id = userInfo.Group_Id;
model.RB_Branch_id = userInfo.School_Id; model.RB_Branch_id = userInfo.School_Id;
model.UpdateBy = userInfo.Id; model.UpdateBy = userInfo.Id;
...@@ -155,6 +163,18 @@ namespace Edu.WebApi.Controllers.User ...@@ -155,6 +163,18 @@ namespace Edu.WebApi.Controllers.User
return saveInfo.result ? ApiResult.Success("请求成功!", saveInfo.id) : ApiResult.Failed("请求失败!"); return saveInfo.result ? ApiResult.Success("请求成功!", saveInfo.id) : ApiResult.Failed("请求失败!");
} }
/// <summary>
/// 获取实体类
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetDictvalue()
{
string Key = base.ParmJObj.GetStringValue("Key");
var model= attendancemodule.GetDictValueList(base.UserInfo.Group_Id, Key)?.FirstOrDefault();
return ApiResult.Success(data: model);
}
/// <summary> /// <summary>
/// 获取公告设置字典实体 /// 获取公告设置字典实体
/// </summary> /// </summary>
......
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