Commit 21208ac1 authored by 罗超's avatar 罗超

调整字典数据

parent bda0864e
......@@ -109,5 +109,10 @@ namespace Edu.Model.Entity.User
get;
set;
}
/// <summary>
/// 掩码
/// </summary>
public string Mask { get; set; }
}
}
......@@ -66,6 +66,24 @@ namespace Edu.Module.User
return dictvalueRepository.Update(fileds, new WhereHelper(nameof(RB_Dictvalue_Extend.DictKey), Edu.Common.Config.Notice_BaseKey));
}
public (int saveType,bool result,int id) SaveDictModule(RB_Dictvalue model)
{
if (model.ID > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Dictvalue_Extend.Content),model.Content },
{nameof(RB_Dictvalue_Extend.Mask),model.Mask }
};
var result = dictvalueRepository.Update(fileds, new WhereHelper(nameof(RB_Dictvalue_Extend.DictKey), model.DictKey));
return (1, result, model.ID);
}
else {
int newId= dictvalueRepository.Insert(model);
return (0, newId > 0, newId);
}
}
#endregion
/// <summary>
......
......@@ -92,6 +92,8 @@ namespace Edu.WebApi.Controllers.User
Content = item.Content ?? "",
Code = item.Code ?? "",
RB_Group_id = item.RB_Group_id ?? 0,
item.Mask,
item.DictKey,
list = query
};
objlist.Add(obj);
......@@ -116,6 +118,25 @@ namespace Edu.WebApi.Controllers.User
return result ? ApiResult.Success("请求成功!") : ApiResult.Failed("请求失败!");
}
/// <summary>
/// 保存字典数据
/// </summary>
/// <returns></returns>
public ApiResult SaveDict()
{
UserInfo userInfo = base.UserInfo;
var model = JsonConvert.DeserializeObject<RB_Dictvalue_Extend>(RequestParm.Msg.ToString());
model.RB_Group_id = userInfo.Group_Id;
model.RB_Branch_id = userInfo.School_Id;
model.UpdateBy = userInfo.Id;
if (string.IsNullOrEmpty(model.Mask))
{
model.Mask = model.Content;
}
var saveInfo = attendancemodule.SaveDictModule(model);
return saveInfo.result ? ApiResult.Success("请求成功!",saveInfo.id) : ApiResult.Failed("请求失败!");
}
/// <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