Commit 404084de by lcx

保存时添加条件判断,置空原始typeid绑定

parent a7f11b4f
......@@ -10,6 +10,7 @@
using Performance.Services.Queues;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Performance.Api.Controllers
{
......@@ -241,6 +242,19 @@ public ApiResponse DeleteExtractTypeAndScript([FromRoute] int typeId, int script
[HttpPost("type/{hospitalId}/save")]
public ApiResponse EditExtractTypeAndScript([FromRoute] int hospitalId, [FromBody] ExtractConfigResponse request)
{
var shettypes = new int[] { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload, (int)SheetType.SpecialUnit };
if (shettypes.Contains(request.Source))
{
if (request.ModuleId == 0 && string.IsNullOrWhiteSpace(request.ModuleName))
return new ApiResponse(ResponseType.ParameterError, "新增模块信息不能为空");
if (request.Source != (int)SheetType.Income)
{
if (request.ItemId == 0 && string.IsNullOrWhiteSpace(request.ItemName))
return new ApiResponse(ResponseType.ParameterError, "新增提取项不能为空");
}
}
var flag = _preConfigService.EditExtractTypeAndScript(hospitalId, request);
return flag
? new ApiResponse(ResponseType.OK, "操作成功")
......@@ -298,6 +312,18 @@ public ApiResponse<List<TitleValue<int>>> GetConfigs([FromRoute] int hospitalId)
return new ApiResponse<List<TitleValue<int>>>(ResponseType.OK, list);
}
/// <summary>
/// 测算表模块配置项
/// </summary>
/// <param name="hospitalId"></param>
/// <returns></returns>
[HttpGet("modules/items/{hospitalId}")]
public ApiResponse GetModeuleAndItems([FromRoute] int hospitalId)
{
var list = _preConfigService.GetModeuleAndItems(hospitalId);
return new ApiResponse(ResponseType.OK, list);
}
#endregion
}
}
\ No newline at end of file
......@@ -44,6 +44,18 @@ public class ExtractConfigResponse
#endregion
#region Modele & Item
public int ModuleId { get; set; }
public string ModuleName { get; set; }
public int ItemId { get; set; }
public string ItemName { get; set; }
#endregion
public List<ExtractConfigResponse> Children { get; set; } = new List<ExtractConfigResponse>();
}
}
using System.Collections.Generic;
namespace Performance.DtoModels
{
public class TreeItem<T>
{
public T Item { get; set; }
public List<TreeItem<T>> Children { get; set; }
}
public class SelectOption<T>
{
public string Label { get; set; }
public T Value { get; set; }
public int Source { get; set; }
public List<SelectOption<T>> Children { get; set; } = new List<SelectOption<T>>();
}
public class SelectOption : SelectOption<int>
{ }
}
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