Commit 8c4220a9 authored by 黄奎's avatar 黄奎

页面修改

parent c75e05a8
...@@ -44,6 +44,27 @@ namespace Mall.Module.TradePavilion ...@@ -44,6 +44,27 @@ namespace Mall.Module.TradePavilion
return custom_FormRepository.GetCustomFormListRepository(query); return custom_FormRepository.GetCustomFormListRepository(query);
} }
/// <summary>
/// 检查表单是否存在
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool CheckExistsCustomFormModule(RB_Custom_Form_Extend model)
{
IList<WhereHelper> list = new List<WhereHelper>
{
new WhereHelper(nameof(RB_Custom_Form_Extend.FormType), model.FormType),
new WhereHelper(nameof(RB_Custom_Form_Extend.Status), (int)DateStateEnum.Normal),
new WhereHelper(nameof(RB_Custom_Form_Extend.TenantId), model.TenantId)
};
if (model.Id > 0)
{
list.Add(new WhereHelper(nameof(RB_Custom_Form_Extend.Id), model.Id, OperatorEnum.NotEqual));
}
return custom_FormRepository.Exists(list);
}
/// <summary> /// <summary>
/// 新增修改自定义表单 /// 新增修改自定义表单
/// </summary> /// </summary>
......
...@@ -105,6 +105,10 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -105,6 +105,10 @@ namespace Mall.WebApi.Controllers.MallBase
model.CreateDate = DateTime.Now; model.CreateDate = DateTime.Now;
model.UpdateDate = DateTime.Now; model.UpdateDate = DateTime.Now;
model.Status = Common.Enum.DateStateEnum.Normal; model.Status = Common.Enum.DateStateEnum.Normal;
if (customFormModule.CheckExistsCustomFormModule(model))
{
return ApiResult.Failed(message: "已存在此类型的表单!");
};
var flag = customFormModule.SetCustomFormModule(model); var flag = customFormModule.SetCustomFormModule(model);
return flag ? ApiResult.Success(data:model) : ApiResult.Failed(); return flag ? ApiResult.Success(data:model) : ApiResult.Failed();
} }
......
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