Commit b160d0a7 by 李承祥

新增allot/getcompute,根据绩效id,核算对象获取计算好的数据;allot/getspecial,获取特殊核算单元绩效;修改基础配置获取信息

parent dc2de372
......@@ -8,6 +8,7 @@
using Performance.DtoModels;
using Performance.Infrastructure;
using Performance.Services;
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.IO;
......@@ -154,5 +155,27 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
BackgroundJob.Enqueue(() => _perExcelService.Execute(allot));
return new ApiResponse(ResponseType.OK);
}
[Route("getcompute")]
[HttpPost]
public ApiResponse<List<res_compute>> GetCompute([CustomizeValidator(RuleSet = "Select"), FromBody]ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _perExcelService.GetCompute(request.AllotId, request.Type);
return new ApiResponse<List<res_compute>>(ResponseType.OK, "ok", list);
}
[Route("getspecial")]
[HttpPost]
public ApiResponse<List<res_specialunit>> GetSpecial([FromBody]ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _perExcelService.GetSpecial(request.AllotId);
return new ApiResponse<List<res_specialunit>>(ResponseType.OK, "ok", list);
}
}
}
......@@ -18,9 +18,11 @@ namespace Performance.Api.Controllers
public class ConfigController : Controller
{
private ConfigService _configService;
public ConfigController(ConfigService configService)
private AllotService _allotService;
public ConfigController(ConfigService configService, AllotService allotService)
{
_configService = configService;
_allotService = allotService;
}
#region director
......@@ -31,9 +33,9 @@ public ConfigController(ConfigService configService)
/// <returns></returns>
[Route("directorlist")]
[HttpPost]
public ApiResponse<List<DirectorResponse>> GetDireList([FromBody]ApiRequest request)
public ApiResponse<List<DirectorResponse>> GetDireList([CustomizeValidator(RuleSet = "Select"), FromBody]DirectorRequest request)
{
var list = _configService.GetDireList();
var list = _configService.GetDireList(request.AllotID);
return new ApiResponse<List<DirectorResponse>>(ResponseType.OK, "ok", list);
}
......@@ -81,9 +83,9 @@ public ApiResponse DireDelete([CustomizeValidator(RuleSet = "Delete"), FromBody]
#region drugprop
[Route("drugproplist")]
[HttpPost]
public ApiResponse<List<DrugpropResponse>> GetDrugList([FromBody]ApiRequest request)
public ApiResponse<List<DrugpropResponse>> GetDrugList([CustomizeValidator(RuleSet = "Select"), FromBody]DrugpropRequest request)
{
var list = _configService.GetDrugList();
var list = _configService.GetDrugList(request.AllotID);
return new ApiResponse<List<DrugpropResponse>>(ResponseType.OK, "ok", list);
}
......@@ -116,9 +118,9 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]Drug
#region income
[Route("incomelist")]
[HttpPost]
public ApiResponse<List<IncomeResponse>> GetIncomeList([FromBody]ApiRequest request)
public ApiResponse<List<IncomeResponse>> GetIncomeList([CustomizeValidator(RuleSet = "Select"), FromBody]IncomeRequest request)
{
var list = _configService.GetIncomeList();
var list = _configService.GetIncomeList(request.AllotID);
return new ApiResponse<List<IncomeResponse>>(ResponseType.OK, "ok", list);
}
......@@ -151,9 +153,9 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]Inco
#region workyear
[Route("workyearlist")]
[HttpPost]
public ApiResponse<List<WorkyearResponse>> GetWorkList([FromBody]ApiRequest request)
public ApiResponse<List<WorkyearResponse>> GetWorkList([CustomizeValidator(RuleSet = "Select"), FromBody]WorkyearRequest request)
{
var list = _configService.GetWorkList();
var list = _configService.GetWorkList(request.AllotID);
return new ApiResponse<List<WorkyearResponse>>(ResponseType.OK, "ok", list);
}
......
......@@ -49,8 +49,8 @@ public enum SheetType
/// </summary>
public enum PerformanceType
{
/// <summary> 没有绩效 </summary>
[Description("没有绩效")]
/// <summary> </summary>
[Description("")]
Null = 0,
/// <summary> 科室主任人均绩效 </summary>
......@@ -75,6 +75,5 @@ public enum PerformanceType
/// <summary> 临床科室护士长人均绩效 (绩效标准取 护士长 平均值)</summary>
[Description("临床科室护士长人均绩效")]
ReferenceHeadNurse = 7,
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ComputerRequest : ApiRequest
{
/// <summary>
/// 绩效id
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// 绩效基数核算参考对象
/// </summary>
public int Type { get; set; }
}
public class ComputerRequestValidator : AbstractValidator<ComputerRequest>
{
public ComputerRequestValidator()
{
RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleSet("Select", () =>
{
RuleFor(x => x.Type).NotNull().NotEmpty();
});
}
}
}
......@@ -9,19 +9,30 @@ public class DirectorRequest : ApiRequest
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public int AllotID { get; set; }
/// <summary>
/// 绩效类型
/// </summary>
public string TypeName { get; set; }
/// <summary>
/// 职务名称
/// </summary>
public string JobTitle { get; set; }
public Nullable<decimal> Value { get; set; }
/// <summary>
/// 绩效系数
/// </summary>
public decimal Value { get; set; }
public class DirectorRequestValidator : AbstractValidator<DirectorRequest>
{
public DirectorRequestValidator()
{
RuleSet("Select", () =>
{
RuleFor(x => x.AllotID).NotNull().NotEmpty().GreaterThan(0);
});
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
......
......@@ -9,19 +9,30 @@ public class DrugpropRequest : ApiRequest
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public Nullable<decimal> MaxRange { get; set; }
public Nullable<decimal> MinRange { get; set; }
public Nullable<decimal> Value { get; set; }
public int AllotID { get; set; }
/// <summary>
/// 药占比最大范围(小于)
/// </summary>
public decimal MaxRange { get; set; }
/// <summary>
/// 药占比最小范围(大于等于)
/// </summary>
public decimal MinRange { get; set; }
/// <summary>
/// 药占比对应系数
/// </summary>
public decimal Value { get; set; }
public class DrugpropRequestValidator : AbstractValidator<DrugpropRequest>
{
public DrugpropRequestValidator()
{
RuleSet("Select", () =>
{
RuleFor(x => x.AllotID).NotNull().NotEmpty().GreaterThan(0);
});
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
......
......@@ -9,19 +9,30 @@ public class IncomeRequest : ApiRequest
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public int AllotID { get; set; }
/// <summary>
/// 关键字匹配
/// </summary>
public string SheetNameKeyword { get; set; }
/// <summary>
/// 分组名称(医生、护理)
/// </summary>
public string UnitName { get; set; }
public Nullable<decimal> Value { get; set; }
/// <summary>
/// 有效收入占比
/// </summary>
public decimal Value { get; set; }
public class IncomeRequestValidator : AbstractValidator<IncomeRequest>
{
public IncomeRequestValidator()
{
RuleSet("Select", () =>
{
RuleFor(x => x.AllotID).NotNull().NotEmpty().GreaterThan(0);
});
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
......
......@@ -12,7 +12,7 @@ public class PositionRequest : ApiRequest
/// <summary>
/// 绩效ID
/// </summary>
public Nullable<int> AllotID { get; set; }
public int AllotID { get; set; }
/// <summary>
/// 职位名称
......@@ -22,23 +22,28 @@ public class PositionRequest : ApiRequest
/// <summary>
/// 职位归类 1 院领导 2 行政中层 3 行政工勤 4 临床科室主任 5 临床科室副主任 6 临床科室护士长
/// </summary>
public Nullable<int> JobType { get; set; }
public int JobType { get; set; }
/// <summary>
/// 额外补偿系数
/// </summary>
public Nullable<decimal> ExtraFactor { get; set; }
public decimal ExtraFactor { get; set; }
/// <summary>
/// 职位类别 1 普通类别 2 基础绩效来源
/// </summary>
public Nullable<int> State { get; set; }
public int State { get; set; }
public class PositionRequestValidator : AbstractValidator<PositionRequest>
{
public PositionRequestValidator()
{
RuleSet("Select", () =>
{
RuleFor(x => x.AllotID).NotNull().NotEmpty().GreaterThan(0);
});
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
......
......@@ -10,19 +10,30 @@ public class WorkyearRequest : ApiRequest
{
public int ID { get; set; }
public Nullable<int> AllotID { get; set; }
public Nullable<decimal> MaxRange { get; set; }
public Nullable<decimal> MinRange { get; set; }
public Nullable<decimal> Value { get; set; }
public int AllotID { get; set; }
/// <summary>
/// 最大工龄范围(小于)
/// </summary>
public decimal MaxRange { get; set; }
/// <summary>
/// 最小工龄范围(大于等于)
/// </summary>
public decimal MinRange { get; set; }
/// <summary>
/// 绩效系数
/// </summary>
public decimal Value { get; set; }
public class WorkyearRequestValidator : AbstractValidator<WorkyearRequest>
{
public WorkyearRequestValidator()
{
RuleSet("Select", () =>
{
RuleFor(x => x.AllotID).NotNull().NotEmpty().GreaterThan(0);
});
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
......
......@@ -10,10 +10,19 @@ public class DirectorResponse
public Nullable<int> AllotID { get; set; }
/// <summary>
/// 绩效类型
/// </summary>
public string TypeName { get; set; }
/// <summary>
/// 职务名称
/// </summary>
public string JobTitle { get; set; }
/// <summary>
/// 绩效系数
/// </summary>
public Nullable<decimal> Value { get; set; }
}
}
......@@ -10,10 +10,19 @@ public class DrugpropResponse
public Nullable<int> AllotID { get; set; }
/// <summary>
/// 药占比最大范围(小于)
/// </summary>
public Nullable<decimal> MaxRange { get; set; }
/// <summary>
/// 药占比最小范围(大于等于)
/// </summary>
public Nullable<decimal> MinRange { get; set; }
/// <summary>
/// 药占比对应系数
/// </summary>
public Nullable<decimal> Value { get; set; }
}
}
......@@ -10,10 +10,19 @@ public class IncomeResponse
public Nullable<int> AllotID { get; set; }
/// <summary>
/// 关键字匹配
/// </summary>
public string SheetNameKeyword { get; set; }
/// <summary>
/// 分组名称(医生、护理)
/// </summary>
public string UnitName { get; set; }
/// <summary>
/// 有效收入占比
/// </summary>
public Nullable<decimal> Value { get; set; }
}
}
......@@ -10,10 +10,19 @@ public class WorkyearResponse
public Nullable<int> AllotID { get; set; }
/// <summary>
/// 最大工龄范围(小于)
/// </summary>
public Nullable<decimal> MaxRange { get; set; }
/// <summary>
/// 最小工龄范围(大于等于)
/// </summary>
public Nullable<decimal> MinRange { get; set; }
/// <summary>
/// 绩效系数
/// </summary>
public Nullable<decimal> Value { get; set; }
}
}
......@@ -23,22 +23,22 @@ public class cof_director
public int ID { get; set; }
/// <summary>
///
/// 绩效id
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// 绩效类型
/// </summary>
public string TypeName { get; set; }
/// <summary>
///
/// 职务名称
/// </summary>
public string JobTitle { get; set; }
/// <summary>
///
/// 绩效系数
/// </summary>
public Nullable<decimal> Value { get; set; }
}
......
......@@ -26,19 +26,19 @@ public class cof_drugprop
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
/// >
/// 药占比最大范围(小于)
/// </summary>
public Nullable<decimal> MaxRange { get; set; }
/// <summary>
/// <=
/// 药占比最小范围(大于等于)
/// </summary>
public Nullable<decimal> MinRange { get; set; }
/// <summary>
///
/// 药占比对应系数
/// </summary>
public Nullable<decimal> Value { get; set; }
}
......
......@@ -33,12 +33,12 @@ public class cof_income
public string SheetNameKeyword { get; set; }
/// <summary>
///
/// 分组名称(医生、护理)
/// </summary>
public string UnitName { get; set; }
/// <summary>
///
/// 有效收入占比
/// </summary>
public Nullable<decimal> Value { get; set; }
}
......
......@@ -19,17 +19,17 @@ public class cof_workyear
public Nullable<int> AllotID { get; set; }
/// <summary>
/// >
/// 最大工龄范围(小于)
/// </summary>
public Nullable<decimal> MaxRange { get; set; }
/// <summary>
/// <=
/// 最小工龄范围(大于等于)
/// </summary>
public Nullable<decimal> MinRange { get; set; }
/// <summary>
///
/// 绩效系数
/// </summary>
public Nullable<decimal> Value { get; set; }
}
......
......@@ -42,26 +42,11 @@
</ItemGroup>
<ItemGroup>
<Compile Update="T4\AutoContext.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>AutoContext.tt</DependentUpon>
</Compile>
<Compile Update="T4\AutoEntity.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>AutoEntity.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="T4\AutoContext.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AutoContext.cs</LastGenOutput>
</None>
<None Update="T4\AutoEntity.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AutoEntity.cs</LastGenOutput>
</None>
</ItemGroup>
......
......@@ -31,9 +31,9 @@ public class ConfigService : IAutoInjection
/// 获取cof_director列表
/// </summary>
/// <returns></returns>
public List<DirectorResponse> GetDireList()
public List<DirectorResponse> GetDireList(int allotId)
{
var list = _directorRepository.GetEntities();
var list = _directorRepository.GetEntities(t => t.AllotID == allotId);
return Mapper.Map<List<DirectorResponse>>(list);
}
......@@ -90,9 +90,9 @@ public bool DireDelete(DirectorRequest request)
/// 获取cof_drugprop列表
/// </summary>
/// <returns></returns>
public List<DrugpropResponse> GetDrugList()
public List<DrugpropResponse> GetDrugList(int allotId)
{
var list = _drugpropRepository.GetEntities();
var list = _drugpropRepository.GetEntities(t => t.AllotID == allotId);
return Mapper.Map<List<DrugpropResponse>>(list);
}
......@@ -149,9 +149,9 @@ public bool DrugDelete(DrugpropRequest request)
/// 获取cof_income列表
/// </summary>
/// <returns></returns>
public List<IncomeResponse> GetIncomeList()
public List<IncomeResponse> GetIncomeList(int allotId)
{
var list = _incomeRepository.GetEntities();
var list = _incomeRepository.GetEntities(T => T.AllotID == allotId);
return Mapper.Map<List<IncomeResponse>>(list);
}
......@@ -208,9 +208,9 @@ public bool IncomeDelete(IncomeRequest request)
/// 获取cof_drugprop列表
/// </summary>
/// <returns></returns>
public List<WorkyearResponse> GetWorkList()
public List<WorkyearResponse> GetWorkList(int allotId)
{
var list = _workyearRepository.GetEntities();
var list = _workyearRepository.GetEntities(t => t.AllotID == allotId);
return Mapper.Map<List<WorkyearResponse>>(list);
}
......
......@@ -499,5 +499,38 @@ public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, res_baiscnor
return baiscnormList;
}
public List<res_compute> GetCompute(int allotId, int type)
{
var list = new List<res_compute>();
Dictionary<int, List<PerformanceType>> keyValues = new Dictionary<int, List<PerformanceType>>
{
{ 1,new List<PerformanceType>{ PerformanceType.ReferenceDirector } },
{ 2,new List<PerformanceType>{ PerformanceType.ReferenceDirectorAvg } },
{ 3,new List<PerformanceType>{ PerformanceType.ReferenceNurseAvg95, PerformanceType.ReferenceHeadNurse, PerformanceType.Null } },
{ 5,new List<PerformanceType>{ PerformanceType.Director, PerformanceType.DeputyDirector } },
{ 6,new List<PerformanceType>{ PerformanceType.Nurse } }
};
if (keyValues.ContainsKey(type))
{
var conList = keyValues[type].Select(t => EnumHelper.GetDescription(t));
list = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && conList.Contains(t.FitPeople));
}
else if (type == 99)
{
list = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId);
}
else
{
throw new PerformanceException("参数错误,type无效");
}
return Mapper.Map<List<res_compute>>(list);
}
public List<res_specialunit> GetSpecial(int allotId)
{
var list = _perforResspecialunitRepository.GetEntities(t => t.AllotID == allotId);
return Mapper.Map<List<res_specialunit>>(list);
}
}
}
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