Commit 12a2b71e by ruyun.zhang@suvalue.com

Merge branch 'dev' into v2020

parents b4cd4e2b 8a51a500
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
......@@ -11,6 +12,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
namespace Performance.Api.Controllers
......@@ -44,42 +46,72 @@ public class AccountController : Controller
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[NoVerify]
[HttpPost]
[Route("login")]
public ApiResponse<UserIdentity> Login([FromBody]LoginRequest request)
[AllowAnonymous]
public ApiResponse<JwtToken> Login([FromBody]LoginRequest request)
{
var user = _userService.Login(request);
if (user == null)
return new ApiResponse<UserIdentity>(ResponseType.Fail, "用户不存在");
int[] roleArray = new int[] { _options.NurseRole, _options.DirectorRole };
return new ApiResponse<JwtToken>(ResponseType.Fail, "用户不存在");
user.Hospital = _hospitalService.GetUserHopital(user.UserID);
user.Role = _roleService.GetUserRole(user.UserID);
user.IsAgainAdmin = user.Role != null ? roleArray.Contains(user.Role.First().RoleID) : false;
var claims = new Claim[]
{
new Claim(JwtClaimTypes.Id, user.UserID.ToString()),
new Claim(JwtClaimTypes.Login, user.Login),
new Claim(JwtClaimTypes.RealName, user.RealName),
new Claim(JwtClaimTypes.Mail, user.Mail),
new Claim(JwtClaimTypes.AppName, request.AppName ?? ""),
new Claim(JwtClaimTypes.Device, request.Device ?? ""),
new Claim(JwtClaimTypes.Department, user.Department ?? ""),
};
if (string.IsNullOrEmpty(user.Token))
user.Token = Guid.NewGuid().ToString("N");
var jwtToken = JwtTokenHelper.GenerateToken(claims, _options.ExpirationMinutes);
return new ApiResponse<JwtToken>(ResponseType.OK, jwtToken);
}
var option = new MemoryCacheEntryOptions()
/// <summary>
/// 刷新登录JWT TOKEN
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("refresh")]
public ApiResponse<JwtToken> Refresh()
{
var userClaim = _claim.GetUserClaim();
var claims = new Claim[]
{
SlidingExpiration = TimeSpan.FromMinutes(_options.ExpirationMinutes)
new Claim(JwtClaimTypes.Id, userClaim.FirstOrDefault(t => t.Type == JwtClaimTypes.Id).Value),
new Claim(JwtClaimTypes.Login, userClaim.FirstOrDefault(t => t.Type == JwtClaimTypes.Login).Value),
new Claim(JwtClaimTypes.RealName, userClaim.FirstOrDefault(t => t.Type == JwtClaimTypes.RealName).Value),
new Claim(JwtClaimTypes.Mail, userClaim.FirstOrDefault(t => t.Type == JwtClaimTypes.Mail).Value),
new Claim(JwtClaimTypes.AppName, userClaim.FirstOrDefault(t => t.Type == JwtClaimTypes.AppName).Value),
new Claim(JwtClaimTypes.Device, userClaim.FirstOrDefault(t => t.Type == JwtClaimTypes.Device).Value),
new Claim(JwtClaimTypes.Department, userClaim.FirstOrDefault(t => t.Type == JwtClaimTypes.Department).Value),
};
_memoryCache.Set(user.Token, user, option);
return new ApiResponse<UserIdentity>(ResponseType.OK, user);
}
var jwtToken = JwtTokenHelper.GenerateToken(claims, _options.ExpirationMinutes);
// 设置当前请求Jwt失效
var jwt = _claim.GetJwtToken();
//claimService.SetJwtBlacklist(jwt);
return new ApiResponse<JwtToken>(ResponseType.OK, jwtToken);
}
/// <summary>
/// 查询个人信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("selfinfo")]
[HttpPost]
public ApiResponse SelfInfo([FromBody]ApiRequest request)
public ApiResponse SelfInfo()
{
var user = _claim.At(request.Token);
var userid = _claim.GetUserId();
var user = _userService.GetUser(userid);
user.Role = _roleService.GetUserRole(user.UserID);
user.Hospital = _hospitalService.GetUserHopital(user.UserID);
int[] roleArray = new int[] { _options.NurseRole, _options.DirectorRole };
user.IsAgainAdmin = user.Role != null ? roleArray.Contains(user.Role.First().Type ?? 0) : false;
return new ApiResponse(ResponseType.OK, user);
}
......@@ -92,7 +124,7 @@ public ApiResponse SelfInfo([FromBody]ApiRequest request)
[HttpPost]
public ApiResponse<UserResponse> UpdateSelf([CustomizeValidator(RuleSet = "Self"), FromBody]UserRequest request)
{
request.ID = _claim.At(request.Token).UserID;
request.ID = _claim.GetUserId();
var user = _userService.UpdateSelf(request);
return new ApiResponse<UserResponse>(ResponseType.OK, user);
}
......@@ -100,13 +132,12 @@ public ApiResponse<UserResponse> UpdateSelf([CustomizeValidator(RuleSet = "Self"
/// <summary>
/// 用户列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("list")]
[HttpPost]
public ApiResponse<List<UserResponse>> List([FromBody]ApiRequest request)
public ApiResponse<List<UserResponse>> List()
{
var userList = _userService.GetUserList(_claim.At(request.Token).UserID);
var userList = _userService.GetUserList(_claim.GetUserId());
return new ApiResponse<List<UserResponse>>(ResponseType.OK, "ok", userList);
}
......@@ -119,8 +150,8 @@ public ApiResponse<List<UserResponse>> List([FromBody]ApiRequest request)
[HttpPost]
public ApiResponse<UserResponse> Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]UserRequest request)
{
var userIdentity = _claim.At(request.Token);
var user = _userService.Insert(request, userIdentity.UserID);
var userId = _claim.GetUserId();
var user = _userService.Insert(request, userId);
user.Role = request.Role;
return new ApiResponse<UserResponse>(ResponseType.OK, user);
}
......@@ -146,8 +177,13 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]User
[HttpPost]
public ApiResponse<UserResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody]UserRequest request)
{
var userIdentity = _claim.At(request.Token);
var user = _userService.Update(request, userIdentity.IsAgainAdmin);
var userId = _claim.GetUserId();
int[] roleArray = new int[] { _options.NurseRole, _options.DirectorRole };
var roles = _roleService.GetUserRole(userId);
var isAgainAdmin = roles != null ? roleArray.Contains(roles.First().Type ?? 0) : false;
var user = _userService.Update(request, isAgainAdmin);
user.Role = request.Role;
return new ApiResponse<UserResponse>(ResponseType.OK, user);
}
......@@ -161,7 +197,7 @@ public ApiResponse<UserResponse> Update([CustomizeValidator(RuleSet = "Update"),
[HttpPost]
public ApiResponse<UserResponse> Password([FromBody]PasswordRequest request)
{
var userid = _claim.At(request.Token).UserID;
var userid = _claim.GetUserId();
var user = _userService.UpdatePwd(request, userid);
return new ApiResponse<UserResponse>(ResponseType.OK, user);
}
......@@ -169,13 +205,13 @@ public ApiResponse<UserResponse> Password([FromBody]PasswordRequest request)
/// <summary>
/// 角色列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("rolelist")]
[HttpPost]
public ApiResponse<List<sys_role>> RoleList([FromBody]ApiRequest request)
public ApiResponse<List<sys_role>> RoleList()
{
var roleList = _userService.RoleList();
var userid = _claim.GetUserId();
var roleList = _userService.RoleList(userid);
return new ApiResponse<List<sys_role>>(ResponseType.OK, "ok", roleList);
}
......
......@@ -29,6 +29,7 @@ namespace Performance.Api.Controllers
public class AgainAllotController : Controller
{
private AgainAllotService againAllotService;
private RoleService roleService;
private ComputeService computeService;
private ClaimService claimService;
private AllotService allotService;
......@@ -36,6 +37,7 @@ public class AgainAllotController : Controller
private ConfigService configService;
private Application application;
public AgainAllotController(AgainAllotService againAllotService,
RoleService roleService,
ClaimService claimService,
AllotService allotService,
IHostingEnvironment env,
......@@ -44,6 +46,7 @@ public class AgainAllotController : Controller
IOptions<Application> options)
{
this.againAllotService = againAllotService;
this.roleService = roleService;
this.claimService = claimService;
this.allotService = allotService;
this.env = env;
......@@ -58,10 +61,10 @@ public class AgainAllotController : Controller
/// <returns></returns>
[Route("allotlist")]
[HttpPost]
public ApiResponse AllotList([FromBody]ApiRequest request)
public ApiResponse AllotList()
{
var user = claimService.At(request);
var list = againAllotService.GetAllotList(user.UserID);
var userId = claimService.GetUserId();
var list = againAllotService.GetAllotList(userId);
return new ApiResponse(ResponseType.OK, list);
}
......@@ -122,19 +125,21 @@ public ApiResponse Import([FromForm] IFormCollection form)
[HttpPost]
public ApiResponse DepartmentDetail([CustomizeValidator(RuleSet = "Generate"), FromBody]AgainAllotRequest request)
{
var user = claimService.At(request);
var userId = claimService.GetUserId();
var roles = roleService.GetUserRole(userId);
var department = claimService.GetUserClaim(JwtClaimTypes.Department);
var again = againAllotService.GetAgainallot(request.AgainAllotID);
if (again == null)
return new ApiResponse(ResponseType.Fail, "当前二次绩效ID无效");
if (user.Role.First().RoleID == application.DirectorRole)
if (roles.First().Type == application.DirectorRole)
{
var detail = computeService.GetDepartmentDetail(again.AllotID.Value, user.Department, 1);
var detail = computeService.GetDepartmentDetail(again.AllotID.Value, department, 1);
return new ApiResponse(ResponseType.OK, detail);
}
else if (user.Role.First().RoleID == application.NurseRole)
else if (roles.First().Type == application.NurseRole)
{
var detail = computeService.GetDepartmentDetail(again.AllotID.Value, user.Department, 2);
var detail = computeService.GetDepartmentDetail(again.AllotID.Value, department, 2);
return new ApiResponse(ResponseType.OK, detail);
}
return new ApiResponse(ResponseType.Fail, "当前用户角色无法识别");
......@@ -149,8 +154,9 @@ public ApiResponse DepartmentDetail([CustomizeValidator(RuleSet = "Generate"), F
[HttpPost]
public ApiResponse Generate([CustomizeValidator(RuleSet = "Generate"), FromBody]AgainAllotRequest request)
{
var user = claimService.At(request);
var result = againAllotService.Generate(request, user);
var userId = claimService.GetUserId();
var department = claimService.GetUserClaim(JwtClaimTypes.Department);
var result = againAllotService.Generate(request, userId, department);
return new ApiResponse(ResponseType.OK);
}
......@@ -163,8 +169,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Generate"), FromBody]
[HttpPost]
public ApiResponse Detail([CustomizeValidator(RuleSet = "Generate"), FromBody]AgainAllotRequest request)
{
var user = claimService.At(request);
var result = againAllotService.Detail(request, user);
var result = againAllotService.Detail(request);
return new ApiResponse(ResponseType.OK, new { result.AgainSituation, result.SheetExport });
}
}
......
......@@ -29,17 +29,19 @@ public class AllotController : Controller
private IHostingEnvironment _evn;
private ILogger<AllotController> _logger;
private ClaimService _claim;
private readonly LogManageService logManageService;
public AllotController(AllotService allotService,
HospitalService hospitalService, ConfigService configService,
ILogger<AllotController> logger, IHostingEnvironment evn,
ClaimService claim)
ClaimService claim, LogManageService logManageService)
{
_allotService = allotService;
_hospitalService = hospitalService;
_logger = logger;
_evn = evn;
_claim = claim;
this.logManageService = logManageService;
_configService = configService;
}
......@@ -57,6 +59,19 @@ public ApiResponse List([FromBody]AllotRequest request)
}
/// <summary>
/// 生成成功或归档绩效记录
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("list/success")]
[HttpPost]
public ApiResponse Success([FromBody]AllotRequest request)
{
List<AllotResponse> allots = _allotService.GetSuccAllotList(request.HospitalId);
return new ApiResponse(ResponseType.OK, allots);
}
/// <summary>
/// 新增绩效
/// </summary>
/// <param name="request"></param>
......@@ -65,8 +80,8 @@ public ApiResponse List([FromBody]AllotRequest request)
[HttpPost]
public ApiResponse Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]AllotRequest request)
{
var user = _claim.At(request);
var result = _allotService.InsertAllot(request, user.UserID);
var userId = _claim.GetUserId();
var result = _allotService.InsertAllot(request, userId);
_configService.Copy(result);
return new ApiResponse(ResponseType.OK, result);
}
......@@ -155,9 +170,19 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
var allot = _allotService.GetAllot(request.ID);
if (null == allot || string.IsNullOrEmpty(allot.Path))
throw new PerformanceException("当前绩效记录不存在或没有上传数据文件");
var user = _claim.At(request);
//_allotService.Generate(allot, user.Mail);
BackgroundJob.Enqueue(() => _allotService.Generate(allot, user.Mail));
var email = _claim.GetUserClaim(JwtClaimTypes.Mail);
if (allot.States == (int)AllotStates.Wait)
return new ApiResponse(ResponseType.OK, "当前绩效正在等待生成");
logManageService.WriteMsg("生成绩效准备中", $"准备生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效,请稍等!", 1, allot.ID, "ReceiveMessage", true);
_allotService.UpdateAllotStates(allot.ID, (int)AllotStates.Wait, EnumHelper.GetDescription(AllotStates.Wait));
if (_evn.IsEnvironment("Localhost"))
_allotService.Generate(allot, email);
else
BackgroundJob.Schedule(() => _allotService.Generate(allot, email), TimeSpan.FromSeconds(1));
logManageService.WriteMsg("等待绩效生成", $"等待绩效生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage");
//_allotService.Generate(allot, email);
////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email));
return new ApiResponse(ResponseType.OK);
}
......@@ -209,5 +234,37 @@ public ApiResponse AllotCheckResult([CustomizeValidator(RuleSet = "Delete"), Fro
var list = _allotService.AllotCheckResult(allot);
return new ApiResponse(ResponseType.OK, list);
}
/// <summary>
/// 绩效历史日志
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("allotlog")]
[HttpPost]
public ApiResponse AllotLog([CustomizeValidator(RuleSet = "Delete"), FromBody]AllotRequest request)
{
var allot = _allotService.GetAllot(request.ID);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _allotService.AllotLog(allot);
return new ApiResponse(ResponseType.OK, list);
}
/// <summary>
/// 绩效审核通过,绩效下发
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("issued")]
[HttpPost]
public ApiResponse Issued([FromBody]AllotRequest request)
{
var allot = _allotService.GetAllot(request.ID);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
_allotService.UpdateAllotStates(allot.ID, (int)AllotStates.GenerateSucceed, EnumHelper.GetDescription(AllotStates.GenerateSucceed));
return new ApiResponse(ResponseType.OK);
}
}
}
......@@ -129,7 +129,7 @@ public ApiResponse EditAssessData([CustomizeValidator(RuleSet = "Edit"), FromBod
//考核模版列表
[HttpPost]
[Route("tempassesslist")]
public ApiResponse TempAssessList([FromBody]ApiRequest request)
public ApiResponse TempAssessList()
{
return assessService.TempAssessList();
}
......
......@@ -69,13 +69,13 @@ public ApiResponse<List<res_specialunit>> GetSpecial([FromBody]ComputerRequest r
/// <returns></returns>
[Route("getdoctordata")]
[HttpPost]
public ApiResponse<List<DoctorResponse>> GetDoctor([FromBody]ComputerRequest request)
public ApiResponse<List<DeptResponse>> GetDoctor([FromBody]ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetDoctorPerformance(request.AllotId);
return new ApiResponse<List<DoctorResponse>>(ResponseType.OK, "ok", list);
return new ApiResponse<List<DeptResponse>>(ResponseType.OK, "ok", list);
}
/// <summary>
......@@ -85,30 +85,55 @@ public ApiResponse<List<DoctorResponse>> GetDoctor([FromBody]ComputerRequest req
/// <returns></returns>
[Route("getnursedata")]
[HttpPost]
public ApiResponse<List<NurseResponse>> GetNurse([FromBody]ComputerRequest request)
public ApiResponse<List<DeptResponse>> GetNurse([FromBody]ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetNursePerformance(request.AllotId);
return new ApiResponse<List<NurseResponse>>(ResponseType.OK, "ok", list);
return new ApiResponse<List<DeptResponse>>(ResponseType.OK, "ok", list);
}
/// <summary>
/// 科室绩效详情
/// 其他组科室绩效列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("deptdetail")]
[Route("getotherdata")]
[HttpPost]
public ApiResponse<DeptDetailResponse> DeptDetail([FromBody]DeptDetailRequest request)
public ApiResponse<List<DeptResponse>> GetOther([FromBody]ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetOtherPerformance(request.AllotId);
return new ApiResponse<List<DeptResponse>>(ResponseType.OK, "ok", list);
}
/// <summary>
/// 科室绩效详情
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("deptdetail")]
[HttpPost]
public ApiResponse<DeptDataDetails> DeptDetail([FromBody]DeptDetailRequest request)
{
//var allot = _allotService.GetAllot(request.AllotId);
//if (null == allot)
// throw new PerformanceException("当前绩效记录不存在");
//DeptDetailResponse response = _computeService.GetDepartmentDetail(request.AllotId, request.AccountID, request.Type);
if (request.AccountID == 0)
{
if (request.SecondId == 0)
return new ApiResponse<DeptDataDetails>(ResponseType.ParameterError, "参数 AccountID或SecondId 无效");
else
request.AccountID = _computeService.GetAccountId(request.SecondId);
}
DeptDetailResponse response = _computeService.GetDepartmentDetail(request.AllotId, request.AccountID, request.Type);
return new ApiResponse<DeptDetailResponse>(ResponseType.OK, response);
var response = _computeService.DeptDetail(request.AccountID);
return new ApiResponse<DeptDataDetails>(ResponseType.OK, response);
}
/// <summary>
......@@ -136,11 +161,12 @@ public ApiResponse AllCompute([FromBody]ComputerRequest request)
[HttpPost]
public ApiResponse UpdateRealfee([CustomizeValidator(RuleSet = "UpdateReal"), FromBody] ComputerRequest request)
{
var user = _claim.At(request);
var userId = _claim.GetUserId();
var realName = _claim.GetUserClaim(JwtClaimTypes.RealName);
var compute = _computeService.GetComputeSingle(request.ComputeId);
if (null == compute)
throw new PerformanceException("当前数据记录不存在");
compute = _computeService.UpdateRealfee(request, user);
compute = _computeService.UpdateRealfee(request, userId, realName);
return new ApiResponse(ResponseType.OK, "修改成功", compute);
}
......
......@@ -15,9 +15,11 @@ namespace Performance.Api.Controllers
public class EmployeeController : Controller
{
private EmployeeService employeeService;
public EmployeeController(EmployeeService employeeService)
private ClaimService claim;
public EmployeeController(EmployeeService employeeService, ClaimService claim)
{
this.employeeService = employeeService;
this.claim = claim;
}
/// <summary>
......@@ -29,7 +31,7 @@ public EmployeeController(EmployeeService employeeService)
[HttpPost]
public ApiResponse GetEmployeeList([CustomizeValidator(RuleSet = "Select"), FromBody]EmployeeRequest request)
{
var employee = employeeService.GetEmployeeList(request.AllotID.Value);
var employee = employeeService.GetEmployeeList(request.AllotID, claim.GetUserId());
return new ApiResponse(ResponseType.OK, "ok", employee);
}
......@@ -72,5 +74,81 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]Empl
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
/// <summary>
/// 获取临床人员列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("clinic/getlist")]
[HttpPost]
public ApiResponse GetEmployeeClinicList([CustomizeValidator(RuleSet = "Select"), FromBody]im_employee_clinic request)
{
//if ((request.AllotID ?? 0) == 0)
// return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var employee = employeeService.GetEmployeeClinicList(request.AllotID, claim.GetUserId());
return new ApiResponse(ResponseType.OK, "ok", employee);
}
/// <summary>
/// 新增临床人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("clinic/insert")]
[HttpPost]
public ApiResponse InsertClinic([CustomizeValidator(RuleSet = "Insert"), FromBody]im_employee_clinic request)
{
if ((request.AllotID ?? 0) == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
if (string.IsNullOrEmpty(request.AccountingUnit))
return new ApiResponse(ResponseType.ParameterError, "参数AccountingUnit无效!");
if (string.IsNullOrEmpty(request.DoctorName))
return new ApiResponse(ResponseType.ParameterError, "参数DoctorName无效!");
var employee = employeeService.InsertClinic(request);
return new ApiResponse(ResponseType.OK, "ok", employee);
}
/// <summary>
/// 修改临床人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("clinic/update")]
[HttpPost]
public ApiResponse UpdateClinic([CustomizeValidator(RuleSet = "Update"), FromBody]im_employee_clinic request)
{
if ((request.AllotID ?? 0) == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
if (string.IsNullOrEmpty(request.AccountingUnit))
return new ApiResponse(ResponseType.ParameterError, "参数AccountingUnit无效!");
if (string.IsNullOrEmpty(request.DoctorName))
return new ApiResponse(ResponseType.ParameterError, "参数DoctorName无效!");
var employee = employeeService.UpdateClinic(request);
return new ApiResponse(ResponseType.OK, "ok", employee);
}
/// <summary>
/// 删除临床人员
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("clinic/delete")]
[HttpPost]
public ApiResponse DeleteClinic([CustomizeValidator(RuleSet = "Delete"), FromBody]im_employee_clinic request)
{
if (request.ID == 0)
return new ApiResponse(ResponseType.ParameterError, "参数ID无效!");
if (!employeeService.DeleteClinic(request))
return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK);
}
}
}
\ No newline at end of file
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Performance.Api.Controllers
{
[Route("api/[controller]")]
public class GuaranteeController
{
private readonly GuaranteeService guaranteeService;
public GuaranteeController(GuaranteeService guaranteeService)
{
this.guaranteeService = guaranteeService;
}
#region cof_guarantee
/// <summary>
/// 保底绩效配置列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("list")]
[HttpPost]
public ApiResponse<List<GuaranteeResponse>> Guarantee([CustomizeValidator(RuleSet = "Select"), FromBody]GuaranteeRequest request)
{
var list = guaranteeService.GuaranTree(request.AllotId);
return new ApiResponse<List<GuaranteeResponse>>(ResponseType.OK, "ok", list);
}
/// <summary>
/// 新增保底绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("insert")]
[HttpPost]
public ApiResponse<List<cof_guarantee>> GuarantInsert([CustomizeValidator(RuleSet = "Insert"), FromBody]GuaranteeRequest request)
{
if (request.Source == null || request.Source.Count == 0)
return new ApiResponse<List<cof_guarantee>>(ResponseType.ParameterError, "保底来源科室 无效");
var list = guaranteeService.GuarantInsert(request);
return new ApiResponse<List<cof_guarantee>>(ResponseType.OK, "新增配置成功", list);
}
/// <summary>
/// 修改保底绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("update")]
[HttpPost]
public ApiResponse<List<cof_guarantee>> GuarantUpdate([CustomizeValidator(RuleSet = "Update"), FromBody]GuaranteeRequest request)
{
if (request.Source == null || request.Source.Count == 0)
return new ApiResponse<List<cof_guarantee>>(ResponseType.ParameterError, "保底来源科室 无效");
var result = guaranteeService.GuarantUpdate(request);
return new ApiResponse<List<cof_guarantee>>(ResponseType.OK, "修改配置成功", result);
}
/// <summary>
/// 删除保底绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("delete")]
[HttpPost]
public ApiResponse<cof_guarantee> GuarantDelete([CustomizeValidator(RuleSet = "Delete"), FromBody]GuaranteeRequest request)
{
var result = guaranteeService.GuarantDelete(request);
if (result)
return new ApiResponse<cof_guarantee>(ResponseType.OK, "删除配置成功");
return new ApiResponse<cof_guarantee>(ResponseType.Fail, "删除配置失败");
}
/// <summary>
/// 医院核算单元
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("accountingunit")]
[HttpPost]
public ApiResponse<List<TitleValue>> Accounting([CustomizeValidator(RuleSet = "Select"), FromBody]GuaranteeRequest request)
{
var result = guaranteeService.Accounting(request.AllotId);
return new ApiResponse<List<TitleValue>>(ResponseType.OK, "医院核算单元列表", result);
}
#endregion
/// <summary>
/// 医院核算单元
/// </summary>
/// <returns></returns>
[Route("unittype")]
[HttpPost]
public ApiResponse<List<EnumItem>> UnitType()
{
var result = guaranteeService.UnitType();
return new ApiResponse<List<EnumItem>>(ResponseType.OK, "核算单元类型", result);
}
}
}
......@@ -29,9 +29,9 @@ public HospitalController(HospitalService hospitalService, ClaimService claimSer
/// <returns></returns>
[Route("hospitallist")]
[HttpPost]
public ApiResponse<List<HospitalResponse>> GetHospitalList([FromBody]ApiRequest request)
public ApiResponse<List<HospitalResponse>> GetHospitalList()
{
var hospitalList = _hospitalService.GetUserHopital(_claim.At(request.Token).UserID);
var hospitalList = _hospitalService.GetUserHopital(_claim.GetUserId());
return new ApiResponse<List<HospitalResponse>>(ResponseType.OK, "ok", hospitalList);
}
......@@ -44,7 +44,7 @@ public ApiResponse<List<HospitalResponse>> GetHospitalList([FromBody]ApiRequest
[HttpPost]
public ApiResponse<HospitalResponse> Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]HospitalRequest request)
{
var userid = _claim.At(request.Token).UserID;
var userid = _claim.GetUserId();
var hospital = _hospitalService.Insert(request, userid);
_hospitalService.InsertUserHospital(userid, hospital.HosID);
return new ApiResponse<HospitalResponse>(ResponseType.OK, hospital);
......@@ -68,7 +68,7 @@ public ApiResponse<HospitalResponse> Update([CustomizeValidator(RuleSet = "Updat
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Disable]
[ApiDisable]
[Route("delete")]
[HttpPost]
public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]HospitalRequest request)
......
......@@ -32,9 +32,9 @@ public MenuController(MenuService menuService, ClaimService claimService)
/// <returns></returns>
[Route("menulist")]
[HttpPost]
public ApiResponse<List<MenuResponse>> MenuList([FromBody]ApiRequest request)
public ApiResponse<List<MenuResponse>> MenuList()
{
var menuList = _menuService.GetMenuList(_claim.At(request.Token).UserID);
var menuList = _menuService.GetMenuList(_claim.GetUserId());
return new ApiResponse<List<MenuResponse>>(ResponseType.OK, menuList);
}
}
......
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels;
using System;
using System.Collections.Generic;
......@@ -12,6 +13,7 @@ public class NotFoundController : ControllerBase
{
[Route("error/404")]
[HttpGet]
[AllowAnonymous]
public ActionResult<ApiResponse> Get()
{
return new ApiResponse(ResponseType.NotFound, "not found");
......
......@@ -9,22 +9,73 @@
namespace Performance.Api.Controllers
{
[Route("api/[controller]")]
/// <summary>
/// 报表
/// </summary>
[Route("api/report")]
public class ReportController : Controller
{
private AllotService allotService;
private ReportService reportService;
private ReportDataService reportDataService;
private ClaimService claimService;
public ReportController(ReportService reportService, ClaimService claimService)
public ReportController(
ClaimService claimService,
AllotService allotService,
ReportService reportService,
ReportDataService reportDataService)
{
this.allotService = allotService;
this.reportService = reportService;
this.reportDataService = reportDataService;
this.claimService = claimService;
}
[Route("rank")]
[HttpPost]
public ApiResponse Rank([FromBody]HospitalIdRequest request)
{
var allots = allotService.GetAllotList(request.HospitalId);
int[] states = new int[] { 6, 8 };
var result = allots.Where(w => states.Contains(w.States))
.Select(w => new { w.Year, w.Month })
.OrderByDescending(w => w.Year)
.ThenByDescending(w => w.Month);
return new ApiResponse(ResponseType.OK, result);
}
[Route("selection")]
[HttpPost]
public ApiResponse Selection([FromBody]SelectionRequest report)
{
var result = reportDataService.GetReportSelection(report.GroupId);
return new ApiResponse(ResponseType.OK, result);
}
[Route("info")]
[HttpPost]
public ApiResponse Info([FromBody]SelectionRequest report)
{
var result = reportDataService.GetReportInfo(report.GroupId);
return new ApiResponse(ResponseType.OK, result);
}
[Route("search")]
[HttpPost]
public ApiResponse Search([FromBody]SearchReportRequest report)
{
var result = reportDataService.GetReportData(report.HospitalId, report.GroupId, report.ReportId, report.Values ?? new List<SelectionValues>());
return new ApiResponse(ResponseType.OK, result);
}
/// <summary>
/// 首页数据概况
/// </summary>
/// <returns></returns>
[Route("survey")]
[HttpPost]
public ApiResponse Survey([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{
var result = reportService.Survey(request.HospitalId);
......@@ -36,6 +87,7 @@ public ApiResponse Survey([CustomizeValidator(RuleSet = "Query"), FromBody]Repor
/// </summary>
/// <returns></returns>
[Route("doctoravg")]
[HttpPost]
public ApiResponse DoctorAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{
var result = reportService.DoctorAvg(request.HospitalId, request.IsIndex);
......@@ -47,6 +99,7 @@ public ApiResponse DoctorAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Re
/// </summary>
/// <returns></returns>
[Route("nurseavg")]
[HttpPost]
public ApiResponse NurseAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{
var result = reportService.NurseAvg(request.HospitalId, request.IsIndex);
......@@ -58,6 +111,7 @@ public ApiResponse NurseAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Rep
/// </summary>
/// <returns></returns>
[Route("outfeeavg")]
[HttpPost]
public ApiResponse OutFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{
var list = reportService.OutFeeAvg(request.HospitalId);
......@@ -69,6 +123,7 @@ public ApiResponse OutFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Re
/// </summary>
/// <returns></returns>
[Route("inpatfeeavg")]
[HttpPost]
public ApiResponse InpatFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{
var list = reportService.InpatFeeAvg(request.HospitalId);
......@@ -80,6 +135,7 @@ public ApiResponse InpatFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]
/// </summary>
/// <returns></returns>
[Route("medicine")]
[HttpPost]
public ApiResponse Medicine([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{
var list = reportService.Medicine(request.HospitalId, request.IsIndex);
......@@ -91,6 +147,7 @@ public ApiResponse Medicine([CustomizeValidator(RuleSet = "Query"), FromBody]Rep
/// </summary>
/// <returns></returns>
[Route("income")]
[HttpPost]
public ApiResponse Income([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{
var list = reportService.Income(request.HospitalId, request.IsIndex);
......@@ -123,5 +180,31 @@ public ApiResponse AvgRatio([CustomizeValidator(RuleSet = "Query"), FromBody]Rep
var list = reportService.AvgRatio(request.HospitalId);
return new ApiResponse(ResponseType.OK, "", list);
}
/// <summary>
/// 首页报表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("index")]
[HttpPost]
public ApiResponse IndexReport([CustomizeValidator(RuleSet = "Index"), FromBody]ReportRequest request)
{
var list = reportService.IndexReport(request.HospitalId, request.Source);
return new ApiResponse(ResponseType.OK, "", list);
}
/// <summary>
/// 菜单报表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("menu")]
[HttpPost]
public ApiResponse MenuReport([CustomizeValidator(RuleSet = "Menu"), FromBody]ReportRequest request)
{
var list = reportService.MenuReport(request);
return new ApiResponse(ResponseType.OK, "", list);
}
}
}
\ No newline at end of file
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels;
using Performance.DtoModels.Request;
......@@ -29,7 +30,7 @@ public SmsController(SmsService smsService)
/// <returns></returns>
[Route("code")]
[HttpPost]
[NoVerify]
[AllowAnonymous]
public ApiResponse Code([FromBody]SmsCodeRequest request)
{
if (!_smsService.SendCode(request.Type, request.Mobile))
......@@ -44,7 +45,7 @@ public ApiResponse Code([FromBody]SmsCodeRequest request)
/// <returns></returns>
[Route("check")]
[HttpPost]
[NoVerify]
[AllowAnonymous]
public ApiResponse Check([CustomizeValidator(RuleSet = "SmsCheck")][FromBody]SmsCodeRequest request)
{
if (!_smsService.Check(request.Mobile, request.Code))
......
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using Performance.Services;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -10,18 +13,26 @@ namespace Performance.Api.Controllers
[ApiController]
public class ValuesController : ControllerBase
{
private readonly IHubContext<AllotLogHub> hubContext;
public ValuesController(IHubContext<AllotLogHub> hubContext)
{
this.hubContext = hubContext;
}
// GET api/values
[HttpGet]
[NoVerify]
[AllowAnonymous]
public ActionResult<IEnumerable<string>> Get()
{
hubContext.Clients.Group("aaaa").SendAsync("ReceiveMessage", "绩效开始执行", "绩效开始执行");
//var excel = _excelService.Analyze(@"C:\Users\ry\Desktop\文件\测试.xlsx");
return new string[] { "value1", "value2" };
}
// GET api/values/5
[HttpGet("{id}")]
[NoVerify]
[AllowAnonymous]
public ActionResult<string> Getid(int id)
{
return "value";
......
......@@ -33,37 +33,20 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
var request = context.HttpContext.Request;
//记录Request请求
var authorization = context.HttpContext.Request.Headers["Authorization"];
var req = new { request.Path, request.Method, context.ActionArguments, Token = authorization.Count > 0 ? authorization.First() : "" };
_logger.LogInformation($"请求内容 {JsonHelper.Serialize(req)}");
//启用body倒带功能
request.EnableRewind();
//记录Request请求
var kv = GetRequestContent(request);
_logger.LogInformation($"请求内容 {request.Method}:{JsonHelper.Serialize(kv)}");
LogHelper.Information($"请求地址:{context.HttpContext.Request.Path};请求参数:{JsonHelper.Serialize(kv)}", "请求内容");
//接口禁用
var disable = ((ControllerActionDescriptor)context.ActionDescriptor).MethodInfo.GetCustomAttributes(typeof(DisableAttribute), true);
if (disable.Length > 0)
if (context.Filters.Any(item => item is ApiDisableAttribute))
{
var response = new ApiResponse(ResponseType.Disable, "接口已禁用");
context.Result = new ObjectResult(response);
return;
}
//token验证
if (!_env.IsDevelopment())
{
var arry = ((ControllerActionDescriptor)context.ActionDescriptor).MethodInfo.GetCustomAttributes(typeof(NoVerifyAttribute), true);
if (arry.Length == 0)
{
var token = kv.GetValue("token", "");
var user = _cache.Get<UserIdentity>(token);
if (string.IsNullOrEmpty(token) || user == null || !user.Token.Equals(token))
{
var response = new ApiResponse(ResponseType.TokenError, "Token无效");
context.Result = new ObjectResult(response);
return;
}
}
}
//验证请求参数
if (!context.ModelState.IsValid)
{
......@@ -74,8 +57,8 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
context.Result = new ObjectResult(response);
var jsonData = JsonHelper.Serialize(context.Result);
_logger.LogInformation($"响应结果:{jsonData}");
LogHelper.Information($"请求地址:{context.HttpContext.Request.Path};响应结果:{jsonData}", "响应结果");
}
//记录response结果
else
{
......@@ -85,66 +68,15 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
if (executedContext.Result is ObjectResult)
{
LogHelper.Information(JsonHelper.Serialize(executedContext.Result), "响应结果");
_logger.LogInformation("响应结果" + JsonHelper.Serialize(executedContext.Result));
var objectResult = (ObjectResult)executedContext.Result;
var jsonData = JsonHelper.Serialize(objectResult.Value);
_logger.LogInformation($"响应结果:{jsonData}");
LogHelper.Information($"请求地址:{context.HttpContext.Request.Path};响应结果:{jsonData}", "响应结果");
_logger.LogInformation($"请求地址:{context.HttpContext.Request.Path};响应结果:{jsonData}");
}
}
}
/// <summary>
/// 读取请求内容
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
private SortedDictionary<string, object> GetRequestContent(HttpRequest request)
{
if (request.Method.Equals("POST"))
{
if (request.Body.CanSeek)
{
var types = request.ContentType.Split(';');
if (types.Contains("application/json"))
{
using (var stream = request.Body)
{
stream.Position = 0;
var reader = new StreamReader(stream, Encoding.UTF8);
var requestContext = reader.ReadToEnd();
return JsonHelper.DeserializeLower(requestContext);
}
}
else if (types.Contains("application/x-www-form-urlencoded") || types.Contains("multipart/form-data"))
{
return request.Form.ToDictionary();
}
else if (types.Contains("text/xml"))
{
//暂不处理
}
}
}
else
{
if (request.Query.Count > 0)
{
var kv = new SortedDictionary<string, object>();
foreach (var item in request.Query)
{
kv.Add(item.Key, item.Value);
}
return kv;
}
}
return new SortedDictionary<string, object>();
}
}
[AttributeUsage(AttributeTargets.Method)]
public class NoVerifyAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
public class DisableAttribute : Attribute { }
public class ApiDisableAttribute : Attribute, IFilterMetadata { }
}
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Authorization;
using Microsoft.AspNetCore.Mvc.Filters;
using Performance.DtoModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
namespace Performance.Api
{
public class AuthenticationFilter : IAsyncAuthorizationFilter
{
private readonly ClaimService claimService;
public AuthenticationFilter(ClaimService claimService)
{
this.claimService = claimService;
}
public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
{
if (context.Filters.Any(item => item is IAllowAnonymousFilter))
return;
var headers = context.HttpContext.Request.Headers;
var authorization = headers["Authorization"];
if (authorization.Count == 0 || string.IsNullOrEmpty(authorization.First()))
{
var response = new ApiResponse(ResponseType.TokenError, "Token无效");
context.Result = new ObjectResult(response);
return;
}
// 获取token字符串
var token = authorization.First().Replace("Bearer ", "");
// jwt是否被禁用
if (!claimService.JwtUsable(token))
{
var response = new ApiResponse(ResponseType.TokenError, "当前请求Token已被禁用");
context.Result = new ObjectResult(response);
return;
}
// 调用此方法,根据token生成对应的"身份证持有人"
var principal = await AuthenticateJwtToken(token);
if (principal == null)
{
var response = new ApiResponse(ResponseType.TokenError, "Token无效");
context.Result = new ObjectResult(response);
}
else
{
context.HttpContext.User = principal; // 设置身份验证的主体
}
}
private Task<ClaimsPrincipal> AuthenticateJwtToken(string token)
{
if (ValidateToken(token, out Claim[] claims))
{
var infos = new ClaimsIdentity(claims, "Jwt");
ClaimsPrincipal user = new ClaimsPrincipal(infos);
return Task.FromResult(user);
}
return Task.FromResult<ClaimsPrincipal>(null);
}
private bool ValidateToken(string token, out Claim[] claims)
{
// 调用自定义的GetPrincipal获取Token的信息对象
var simplePrinciple = JwtTokenHelper.GetPrincipal(token);
// 获取主声明标识
var identity = simplePrinciple?.Identity as ClaimsIdentity;
claims = new Claim[] { };
if (identity == null)
return false;
if (identity.Claims != null && identity.Claims.Any())
claims = identity.Claims.ToArray();
return identity.IsAuthenticated;
}
}
}
......@@ -26,21 +26,21 @@ public Task OnExceptionAsync(ExceptionContext context)
_logger.LogWarning($"接口错误警告:{context.Exception.ToString()}");
var response = new ApiResponse(ResponseType.Fail, context.Exception.Message);
context.Result = new ObjectResult(response);
LogHelper.Warning(JsonHelper.Serialize(response), "接口错误警告");
_logger.LogWarning("接口错误警告" + JsonHelper.Serialize(response));
}
else if (context.Exception is PerformanceTokenErrorException)
{
_logger.LogWarning($"Token Error:{context.Exception.ToString()}");
var response = new ApiResponse(ResponseType.TokenError, context.Exception.Message);
context.Result = new ObjectResult(response);
LogHelper.Warning(JsonHelper.Serialize(response), "Token Error");
_logger.LogWarning("Token Error" + JsonHelper.Serialize(response));
}
else
{
_logger.LogError($"接口异常:{context.Exception.ToString()}");
var response = new ApiResponse(ResponseType.Error, "接口内部异常", context.Exception.Message);
context.Result = new ObjectResult(response);
LogHelper.Error(JsonHelper.Serialize(response), "接口内部异常");
_logger.LogError("接口内部异常" + JsonHelper.Serialize(response));
}
return Task.CompletedTask;
}
......
......@@ -5,13 +5,35 @@
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath />
<DocumentationFile>..\Performance.Api\wwwroot\Performance.Api.xml</DocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Remove="aaa\**" />
<Compile Remove="Files\**" />
<Compile Remove="Hubs\**" />
<Content Remove="aaa\**" />
<Content Remove="Files\**" />
<Content Remove="Hubs\**" />
<EmbeddedResource Remove="aaa\**" />
<EmbeddedResource Remove="Files\**" />
<EmbeddedResource Remove="Hubs\**" />
<None Remove="aaa\**" />
<None Remove="Files\**" />
<None Remove="Hubs\**" />
</ItemGroup>
<ItemGroup>
<None Remove="Template\~%24医院绩效模板.xlsx" />
</ItemGroup>
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="8.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.0.0" />
......@@ -23,7 +45,7 @@
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="MySql.Data" Version="8.0.15" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.15" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
......@@ -31,6 +53,7 @@
<PackageReference Include="NLog.Extensions.Logging" Version="1.4.0" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.8.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="Microsoft.AspNet.SignalR" Version="2.4.1" />
</ItemGroup>
<ItemGroup>
......@@ -45,6 +68,36 @@
<Content Update="nlog.config">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\Performance.Api.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\Performance.EntityModels.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Update="Template\东方医院绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Template\医院二次分配绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Template\医院绩效模板%28无执行科室%29.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Template\医院绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="Template\医院二次分配绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Template\医院绩效模板.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JSONSchema="" /></VisualStudio></ProjectExtensions>
......
......@@ -12,16 +12,20 @@
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "api/values",
"launchUrl": "index.html",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
//"ASPNETCORE_ENVIRONMENT": "Development"
//"ASPNETCORE_ENVIRONMENT": "Production"
"ASPNETCORE_ENVIRONMENT": "Localhost"
}
},
"Performance.Api": {
"commandName": "Project",
"launchUrl": "api/values",
"launchUrl": "index.html",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
//"ASPNETCORE_ENVIRONMENT": "Development"
//"ASPNETCORE_ENVIRONMENT": "Production"
"ASPNETCORE_ENVIRONMENT": "Localhost"
},
"applicationUrl": "http://localhost:5001"
}
......
......@@ -26,6 +26,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reflection;
......@@ -47,7 +48,7 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
LogHelper.Initialize(Configuration.GetSection("AppConnection:RedisConnectionString").Value, "MTEzMTAyMzEzNDYzMzY5MzE4NA");
//LogHelper.Initialize(Configuration.GetSection("AppConnection:RedisConnectionString").Value, "MTEzMTAyMzEzNDYzMzY5MzE4NA");
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
#region appsetting注入
......@@ -66,6 +67,7 @@ public void ConfigureServices(IServiceCollection services)
//筛选器配置
.AddMvc(option =>
{
option.Filters.Add<AuthenticationFilter>();
option.Filters.Add<ActionsFilter>();
option.Filters.Add<ExceptionsFilter>();
})
......@@ -108,12 +110,6 @@ public void ConfigureServices(IServiceCollection services)
.AddPerformanceRepoitory();
#endregion
#region swagger
//services.AddSwaggerGen(c =>
//{
// c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });
//});
#endregion
#region custom util
......@@ -139,10 +135,12 @@ public void ConfigureServices(IServiceCollection services)
#endregion
#region redis
var csredis = new CSRedis.CSRedisClient(connection.Value.RedisConnectionString);
RedisHelper.Initialization(csredis);
//var csredis = new CSRedis.CSRedisClient(connection.Value.RedisConnectionString);
//RedisHelper.Initialization(csredis);
#endregion
services.AddMemoryCache();
#region hangfire
services.AddHangfire(config =>
{
......@@ -151,12 +149,57 @@ public void ConfigureServices(IServiceCollection services)
});
#endregion
services.AddSignalR();
services.AddCors(options =>
{
options.AddPolicy("SignalrCore", policy =>
{
policy.SetIsOriginAllowed(origin => true).AllowAnyHeader().AllowAnyMethod().AllowCredentials();
});
});
#region //ef配置
services.AddDbContext<PerformanceDbContext>(options =>
{
options.UseMySQL(connection.Value.PerformanceConnectionString);
});
#endregion
#region swagger
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Version = "v1.0", Title = "绩效API接口" });
var xmlPath = new string[]
{
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", "Performance.Api.xml"),
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", "Performance.DtoModels.xml"),
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", "Performance.EntityModels.xml"),
};
var xmlPathsss = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", "Performance.Api.xml");
c.IncludeXmlComments(xmlPathsss, true);
//foreach (var item in xmlPath)
//{
// c.IncludeXmlComments(item, true);
//}
#region Token绑定到ConfigureServices
var security = new Dictionary<string, IEnumerable<string>> { { "Performance API", new string[] { } }, };
c.AddSecurityRequirement(security);
c.AddSecurityDefinition("Performance API", new ApiKeyScheme
{
Description = "JWT授权(数据将在请求头中进行传输) 直接在下框中输入Bearer {token}(注意两者之间是一个空格)",
Name = "Authorization",
In = "HEADER"
});
#endregion
});
#endregion
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
......@@ -171,16 +214,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
{
app.UseStatusCodePagesWithReExecute("/error/{0}");
}
//// Enable middleware to serve generated Swagger as a JSON endpoint.
//app.UseSwagger();
//// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
//// specifying the Swagger JSON endpoint.
//app.UseSwaggerUI(c =>
//{
// c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
// c.RoutePrefix = string.Empty;
//});
#region Swagger
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint(Configuration["Application:SwaggerEndpoint"], "v1.0");
//c.SwaggerEndpoint("/swagger/v1/swagger.json", "v1.0");
c.RoutePrefix = "";
});
#endregion
#region hangfire
......@@ -188,6 +231,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new[] { new HangfireAuthorizationFilter() } });
#endregion
app.UseCors("SignalrCore");
app.UseSignalR(routes => routes.MapHub<AllotLogHub>("/performance/allotLogHub"));
loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName);
app.UseMvc();
}
......
using Microsoft.Extensions.Caching.Memory;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Caching.Memory;
using Performance.DtoModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
namespace Performance.Api
{
public class ClaimService
{
IMemoryCache _memoryCache;
public ClaimService(IMemoryCache memoryCache)
private readonly IHttpContextAccessor contextAccessor;
private readonly IMemoryCache memoryCache;
public ClaimService(IHttpContextAccessor contextAccessor, IMemoryCache memoryCache)
{
this.contextAccessor = contextAccessor;
this.memoryCache = memoryCache;
}
/// <summary>
/// 获取当前请求登录ID
/// </summary>
/// <returns></returns>
public int GetUserId()
{
var claim = GetUserClaim().FirstOrDefault(t => t.Type == JwtClaimTypes.Id);
if (claim == null)
{
throw new PerformanceTokenErrorException("获取当前登录用户ID失败");
}
return Convert.ToInt32(claim.Value);
}
/// <summary>
/// 获取当前请求登录ID
/// </summary>
/// <returns></returns>
public string GetUserClaim(string jwtClaimTypes)
{
var claim = GetUserClaim().FirstOrDefault(t => t.Type == jwtClaimTypes);
if (claim == null)
{
throw new PerformanceTokenErrorException("获取当前登录用户ID失败");
}
return claim.Value;
}
/// <summary>
/// 获取当前请求所有身份信息
/// </summary>
/// <returns></returns>
public List<Claim> GetUserClaim()
{
if (contextAccessor.HttpContext.User == null)
{
throw new PerformanceException("获取当前请求登录信息失败");
}
return contextAccessor.HttpContext.User.Claims.ToList();
}
/// <summary>
/// 获取当前请求Jwt Token
/// </summary>
/// <returns></returns>
public string GetJwtToken()
{
var authorization = contextAccessor.HttpContext.Request.Headers["Authorization"];
if (authorization.Count == 0 || string.IsNullOrEmpty(authorization.First()))
{
throw new PerformanceException("获取当前请求Authorization失败");
}
return authorization.First().Replace("Bearer ", "");
}
/// <summary>
/// 设置jwt进入黑名单
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
public bool SetJwtBlacklist(string token)
{
_memoryCache = memoryCache;
memoryCache.Set(token, DateTime.Now);
return true;
}
public UserIdentity At(ApiRequest request)
/// <summary>
/// 判断当前请求JWT是否可用 可用true
/// </summary>
/// <returns></returns>
public bool JwtUsable()
{
return At(request.Token);
string token = GetJwtToken();
return JwtUsable(token);
}
public UserIdentity At(string token)
/// <summary>
/// 判断当前请求JWT是否可用 可用true
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
public bool JwtUsable(string token)
{
if (string.IsNullOrEmpty(token))
throw new PerformanceTokenErrorException("token is not null");
var user = _memoryCache.Get<UserIdentity>(token);
if (user == null)
throw new PerformanceTokenErrorException("当前用户未登录");
return user;
var @object = memoryCache.Get(token);
return @object == null;
}
}
}
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.IO;
using System.Linq;
using System.Security.Claims;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace Performance.Api
{
public class JwtTokenHelper
{
private static byte[] secret = Encoding.ASCII.GetBytes(Consts.Secret);
public static JwtToken GenerateToken(Claim[] claims, int expiresMinute)
{
var authTime = DateTime.UtcNow;
var expiresAt = authTime.AddMinutes(expiresMinute);
var tokenDescriptor = new SecurityTokenDescriptor
{
Audience = Consts.Audience,
Issuer = Consts.Issuer,
Subject = new ClaimsIdentity(claims),
Expires = expiresAt,
SigningCredentials = new SigningCredentials(
new SymmetricSecurityKey(secret), SecurityAlgorithms.HmacSha256Signature)
};
var tokenHandler = new JwtSecurityTokenHandler();
var token = tokenHandler.CreateToken(tokenDescriptor);
var tokenString = tokenHandler.WriteToken(token);
return new JwtToken
{
access_token = tokenString,
token_type = "Bearer",
auth_time = new DateTimeOffset(authTime).ToUnixTimeSeconds(),
expires_at = new DateTimeOffset(expiresAt).ToUnixTimeSeconds()
};
}
public static ClaimsPrincipal GetPrincipal(string token)
{
try
{
// 创建一个JwtSecurityTokenHandler类,用来后续操作
var tokenHandler = new JwtSecurityTokenHandler();
// 将字符串token解码成token对象
var jwtToken = tokenHandler.ReadToken(token) as JwtSecurityToken;
if (jwtToken == null) return null;
// 生成验证token的参数
var validationParameters = new TokenValidationParameters()
{
RequireExpirationTime = true,
ValidateIssuer = true,
ValidateAudience = true,
ValidAudience = Consts.Audience,
ValidIssuer = Consts.Issuer,
IssuerSigningKey = new SymmetricSecurityKey(secret)
};
var principal = tokenHandler.ValidateToken(token, validationParameters, out SecurityToken securityToken);
// 返回秘钥的主体对象,包含秘钥的所有相关信息
return principal;
}
catch (Exception ex)
{
return null;
}
}
}
public class JwtToken
{
/// <summary>
/// access token
/// </summary>
public string access_token { get; set; }
/// <summary>
/// token type
/// </summary>
public string token_type { get; set; }
/// <summary>
/// 授权时间
/// </summary>
public long auth_time { get; set; }
/// <summary>
/// 过期时间
/// </summary>
public long expires_at { get; set; }
}
public static class JwtClaimTypes
{
public const string Id = "id";
public const string Login = "login";
public const string RealName = "realname";
public const string Mail = "mail";
public const string AppName = "appname";
public const string Device = "device";
public const string Department = "department";
}
public static class Consts
{
public const string Secret = "DH4neb6Aipe1ortdalusvo8iosQiBIYupLNPTu3j40PZ9tBbLrPD4mAmDVsB7nZw";
public const string Issuer = "suvalue";
public const string Audience = "jixiao.suvalue.com";
}
}
......@@ -13,7 +13,7 @@
},
"Application": {
//登录过期时间
"ExpirationMinutes": "420",
"ExpirationMinutes": "120",
//验证码过期
"SmsCodeMinutes": "5",
//护士长二次绩效管理员
......@@ -26,6 +26,7 @@
"WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index",
"ImportFile": ""
"ImportFile": "http://localhost:5001/api/template/savefile",
"HttpPost": "http://localhost:50997/api"
}
}
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"AppConnection": {
"PerformanceConnectionString": "server=192.168.18.166;database=db_performance;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;",
"RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2"
},
"Application": {
//登录过期时间
"ExpirationMinutes": "120",
//验证码过期
"SmsCodeMinutes": "5",
//护士长二次绩效管理员
"NurseRole": "3",
//科主任二次绩效管理员
"DirectorRole": "4",
"AbsolutePath": "E:\\wwwroot\\testjx.suvalue.com",
"HttpPath": "http://testjx.suvalue.com:81",
"SwaggerEndpoint": "/swagger/v1/swagger.json"
},
"WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index",
"ImportFile": "http://localhost:5001/api/template/savefile",
"HttpPost": "http://localhost:50997/api"
}
}
......@@ -20,7 +20,8 @@
"EmailOptions": {
"SmtpServer": "smtpdm.aliyun.com",
"Account": "service@email.suvalue.com",
"Password": "SuValue123456"
"Password": "SuValue123456",
"IsEnable": true
},
"Application": {
//登录过期时间
......@@ -36,11 +37,13 @@
//邮件指定接收人
"Receiver": [ "chengxiang.li@suvalue.com", "486035085@qq.com" ],
"AbsolutePath": "E:\\wwwroot\\testjx.suvalue.com",
"HttpPath": "http://testjx.suvalue.com:81"
"HttpPath": "http://testjx.suvalue.com:81",
"SwaggerEndpoint": "/api/swagger/v1/swagger.json"
},
"WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index",
"ImportFile": "http://localhost:5001/api/template/savefile"
"ImportFile": "http://localhost:5001/api/template/savefile",
"HttpPost": "http://localhost:50997/api"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -55,7 +55,7 @@ static void Main(string[] args)
var option = services.BuildServiceProvider().GetService<IOptions<EmailOptions>>();
services.AddEmailUtil(config => { config.Account = option.Value.Account; config.Password = option.Value.Password; config.SmtpServer = option.Value.SmtpServer; });
services.AddEmailUtil(config => { config.Account = option.Value.Account; config.Password = option.Value.Password; config.SmtpServer = option.Value.SmtpServer; config.IsEnable = option.Value.IsEnable; });
var emailService = services.BuildServiceProvider().GetService<IEmailService>();
var message = new EmailMessage
{
......
......@@ -20,7 +20,8 @@
"EmailOptions": {
"SmtpServer": "smtpdm.aliyun.com",
"Account": "service@email.suvalue.com",
"Password": "SuValue123456"
"Password": "SuValue123456",
"IsEnable": true
},
"Application": {
//登录过期时间
......
......@@ -6,27 +6,27 @@
namespace Performance.DtoModels
{
public class ApiRequest
{
/// <summary>
/// 登录后返回登录令牌
/// </summary>
public string Token { get; set; }
/// <summary>
/// 版本号 v1
/// </summary>
public string Version { get; set; }
/// <summary>
/// 设备号 1 苹果 2 安卓 3 网页
/// </summary>
public string Device { get; set; }
/// <summary>
/// App名称
/// </summary>
public string AppName { get; set; }
///// <summary>
///// 操作用户
///// </summary>
//public Nullable<int> ActiveUID { get; set; }
}
//public class ApiRequest
//{
// /// <summary>
// /// 登录后返回登录令牌
// /// </summary>
// public string Token { get; set; }
// /// <summary>
// /// 版本号 v1
// /// </summary>
// public string Version { get; set; }
// /// <summary>
// /// 设备号 1 苹果 2 安卓 3 网页
// /// </summary>
// public string Device { get; set; }
// /// <summary>
// /// App名称
// /// </summary>
// public string AppName { get; set; }
// ///// <summary>
// ///// 操作用户
// ///// </summary>
// //public Nullable<int> ActiveUID { get; set; }
//}
}
......@@ -20,5 +20,10 @@ public class WebapiUrl
/// 上传文件地址
/// </summary>
public string ImportFile { get; set; }
/// <summary>
/// Post请求地址
/// </summary>
public string HttpPost { get; set; }
}
}
......@@ -17,12 +17,34 @@ public enum SmsCodeType
/// <summary> 用户状态 </summary>
public enum States
{
[Description("登录")]
[Description("启用")]
Enabled = 1,
[Description("其他")]
[Description("禁用")]
Disabled = 2,
}
/// <summary> 提取数据使用模板 </summary>
public enum UseTemplate
{
/// <summary> 上次绩效 </summary>
[Description("上次绩效")]
LastAllot = 1,
/// <summary> 配置模板 </summary>
[Description("配置模板")]
Config = 2,
}
/// <summary> 提取数据使用模板 </summary>
public enum DbSrouceType
{
/// <summary> 标准库 </summary>
[Description("标准库")]
Standard = 1,
/// <summary> 绩效库 </summary>
[Description("绩效库")]
Performance = 2,
}
public enum AllotStates
{
/// <summary> 用户状态 </summary>
......@@ -43,7 +65,7 @@ public enum AllotStates
/// <summary> 正在生成绩效 </summary>
[Description("正在生成绩效")]
InGenerate = 5,
/// <summary> 绩效结果解析成功 </summary>
/// <summary> 绩效结果通过审核,允许下发 </summary>
[Description("数据验证通过")]
GenerateSucceed = 6,
/// <summary> 绩效解析失败 </summary>
......@@ -52,5 +74,11 @@ public enum AllotStates
/// <summary> 归档 </summary>
[Description("归档")]
Archive = 8,
/// <summary> 归档 </summary>
[Description("等待")]
Wait = 9,
/// <summary> 绩效结果解析成功 </summary>
[Description("数据验证通过")]
GenerateAccomplish = 10,
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ExtractDto
{
public string Department { get; set; }
public string Category { get; set; }
public decimal Value { get; set; }
}
}
......@@ -47,6 +47,16 @@ public class ComputeEmployee
public string JobTitle { get; set; }
/// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
/// <summary>
/// 基础绩效系数
/// </summary>
public Nullable<decimal> Basics { get; set; }
/// <summary>
/// 岗位系数
/// </summary>
public Nullable<decimal> PostCoefficient { get; set; }
......@@ -95,5 +105,25 @@ public class ComputeEmployee
///// 发放系数
///// </summary>
//public Nullable<decimal> Grant { get; set; }
/// <summary>
/// 核算单元分类
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 效率绩效系数
/// </summary>
public Nullable<decimal> Efficiency { get; set; }
/// <summary>
/// 规模绩效系数
/// </summary>
public Nullable<decimal> Scale { get; set; }
/// <summary>
/// 管理绩效发放系数
/// </summary>
public Nullable<decimal> Management { get; set; }
}
}
......@@ -96,6 +96,11 @@ public class ComputeResult
public Nullable<decimal> GiveFee { get; set; }
/// <summary>
/// 参考基数专用绩效合计
/// </summary>
public Nullable<decimal> BaiscNormPerforTotal { get; set; }
/// <summary>
/// 参加工作时间(来自人员名单)
/// </summary>
public Nullable<DateTime> WorkTime { get; set; }
......@@ -125,6 +130,15 @@ public class ComputeResult
/// </summary>
public decimal? Adjust { get; set; }
public string UnitType { get; set; }
public string Remark { get; set; }
/// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
///// <summary>
///// 工作量绩效
///// </summary>
......
using System;
using System.Collections.Generic;
using System.Text;
//using System;
//using System.Collections.Generic;
//using System.Text;
namespace Performance.DtoModels
{
public class ComputeSource
{
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
//namespace Performance.DtoModels
//{
// public class ComputeSource
// {
// /// <summary>
// /// 核算单元
// /// </summary>
// public string AccountingUnit { get; set; }
/// <summary>
/// 核算单元医生数量
/// </summary>
public Nullable<decimal> Number { get; set; }
// /// <summary>
// /// 核算单元医生数量
// /// </summary>
// public Nullable<decimal> Number { get; set; }
/// <summary>
/// 医生基础系数
/// </summary>
public Nullable<decimal> BasicFactor { get; set; }
// /// <summary>
// /// 医生基础系数
// /// </summary>
// public Nullable<decimal> BasicFactor { get; set; }
/// <summary>
/// 倾斜系数
/// </summary>
public Nullable<decimal> SlopeFactor { get; set; }
// /// <summary>
// /// 倾斜系数
// /// </summary>
// public Nullable<decimal> SlopeFactor { get; set; }
/// <summary>
/// 其他绩效1
/// </summary>
public Nullable<decimal> OtherPerfor1 { get; set; }
// /// <summary>
// /// 其他绩效1
// /// </summary>
// public Nullable<decimal> OtherPerfor1 { get; set; }
/// <summary>
/// 其他绩效2
/// </summary>
public Nullable<decimal> OtherPerfor2 { get; set; }
// /// <summary>
// /// 其他绩效2
// /// </summary>
// public Nullable<decimal> OtherPerfor2 { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public Nullable<decimal> Extra { get; set; }
// /// <summary>
// /// 医院奖罚
// /// </summary>
// public Nullable<decimal> Extra { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public Nullable<decimal> ScoringAverage { get; set; }
// /// <summary>
// /// 考核对分率
// /// </summary>
// public Nullable<decimal> ScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> AdjustFactor { get; set; }
// /// <summary>
// /// 调节系数
// /// </summary>
// public Nullable<decimal> AdjustFactor { get; set; }
/// <summary>
/// 科室业绩
/// </summary>
public Nullable<decimal> Income { get; set; }
// /// <summary>
// /// 科室业绩
// /// </summary>
// public Nullable<decimal> Income { get; set; }
/// <summary>
/// 业绩绩效
/// </summary>
public Nullable<decimal> PerforFee { get; set; }
// /// <summary>
// /// 业绩绩效
// /// </summary>
// public Nullable<decimal> PerforFee { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public Nullable<decimal> WorkloadFee { get; set; }
// /// <summary>
// /// 工作量绩效
// /// </summary>
// public Nullable<decimal> WorkloadFee { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public Nullable<decimal> PerforTotal { get; set; }
// /// <summary>
// /// 绩效合计
// /// </summary>
// public Nullable<decimal> PerforTotal { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public Nullable<decimal> Avg { get; set; }
// /// <summary>
// /// 人均绩效
// /// </summary>
// public Nullable<decimal> Avg { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public Nullable<decimal> GiveFee { get; set; }
}
}
// /// <summary>
// /// 实发绩效
// /// </summary>
// public Nullable<decimal> GiveFee { get; set; }
// }
//}
......@@ -11,6 +11,24 @@ public enum ExcelVersion
xls
}
/// <summary> 核算单元类型 </summary>
public enum UnitType
{
[Description("医生组")]
医生组 = 1,
[Description("护理组")]
护理组 = 2,
[Description("医技组")]
医技组 = 3,
[Description("专家组")]
专家组 = 4,
[Description("其他组")]
其他组 = 5,
[Description("特殊核算组")]
特殊核算组 = 6,
}
public enum SheetType
{
/// <summary> 无法识别 </summary>
......@@ -56,59 +74,15 @@ public enum SheetType
/// <summary> 临床科室护士绩效测算表 </summary>
[Description("临床科室护士绩效测算表")]
ComputeNurseAccount = 14,
}
/// <summary>
/// 绩效类型
/// </summary>
//public enum PerformanceType
//{
// /// <summary> </summary>
// [Description("")]
// Null = 0,
/// <summary> 临床人员名单 </summary>
[Description("临床人员名单")]
ClinicEmployee = 15,
// /// <summary> 绩效基数临床科室主任(专门用来计算科主任绩效,由此产生=>>临床科室主任人均绩效)</summary>
// [Description("绩效基数临床科室主任")]
// StandardDirector = 1,
// /// <summary> 绩效基数临床科室副主任(专门用来计算科主任绩效,由此产生=>>临床科室副主任人均绩效) </summary>
// [Description("绩效基数临床科室副主任")]
// StandardDeputyDirector = 2,
// /// <summary> 绩效基数临床科室护士长(专门用来计算科主任绩效,由此产生=>>临床科室护士长人均绩效) </summary>
// [Description("绩效基数临床科室护士长")]
// StandardNurse = 3,
// /// <summary> 绩效基数医技科室主任(专门用来计算科主任绩效,由此产生=>>医技科室主任人均绩效) </summary>
// [Description("绩效基数医技科室主任")]
// StandardDirectorYJ = 14,
// /// <summary> 临床科室主任人均绩效 (绩效标准取 科室主任人均绩效) </summary>
// [Description("临床科室主任人均绩效")]
// ReferenceDirector = 4,
// /// <summary> 临床科室中层人均绩效 (绩效标准取 科室主任/护士长/科室副主任/医技主任 平均值) </summary>
// [Description("临床科室中层人均绩效")]
// ReferenceDirectorAvg = 5,
// /// <summary> 临床科室护士长人均绩效 (绩效标准取 护士长 平均值)</summary>
// [Description("临床科室护士长人均绩效")]
// ReferenceHeadNurse = 7,
// /// <summary> 临床科室副主任人均绩效 </summary>
// [Description("临床科室副主任人均绩效")]
// ReferenceDeputyDirector = 8,
// /// <summary> 临床科室医生人均绩效 </summary>
// [Description("临床科室医生人均绩效")]
// ReferenceDoctor = 9,
// /// <summary> 临床科室护士人均绩效 </summary>
// [Description("临床科室护士人均绩效")]
// ReferenceNurse = 10,
// /// <summary> 行政工勤人均绩效 </summary>
// [Description("行政工勤人均绩效")]
// LogisticsWorker = 11,
// /// <summary> 行政中层人均绩效 </summary>
// [Description("行政中层人均绩效")]
// MiddleManager = 12,
// /// <summary> 行政高层人均绩效 </summary>
// [Description("行政高层人均绩效")]
// TopManager = 13,
//}
/// <summary> 特殊临床科室医护绩效测算基础 </summary>
[Description("特殊临床科室医护绩效测算基础")]
AccountBasicSpecial = 16,
}
/// <summary>
/// 核算单元类型
......@@ -119,11 +93,11 @@ public enum AccountUnitType
[Description("")]
Null = 1,
/// <summary> 临床科室 </summary>
[Description("临床科室")]
临床科室 = 2,
[Description("科主任")]
科主任 = 2,
/// <summary> 临床科室 </summary>
[Description("医技科室")]
医技科室 = 3,
[Description("护士长")]
护士长 = 3,
/// <summary> 行政高层 </summary>
[Description("行政高层")]
行政高层 = 4,
......@@ -151,6 +125,8 @@ public enum PerforType
护士,
[Description("临床主任护士长平均")]
临床主任护士长平均,
[Description("临床主任医技主任护士长平均")]
临床主任医技主任护士长平均,
[Description("临床医生人均绩效")]
临床医生,
[Description("医技医生人均绩效")]
......@@ -166,15 +142,32 @@ public enum PerforType
}
/// <summary>
/// 当前枚举为效率绩效、规模绩效中系数中文名称
/// 对应表cof_director中JobTitle 全文字匹配
/// 保底绩效
/// </summary>
public enum DirectorType
public enum MinimumType
{
临床科室主任,
临床科室副主任,
医技科室主任,
医技科室副主任,
临床科室护士长,
[Description("保底绩效临床医生人均绩效")]
保底临床医生 = 1,
[Description("保底绩效医技医生人均绩效")]
保底医技医生 = 2,
[Description("保底绩效护士人均绩效")]
保底护士 = 3,
[Description("保底绩效行政工勤人均绩效")]
保底工勤 = 4,
[Description("自定义保底绩效")]
自定义保底 = 5,
}
///// <summary>
///// 当前枚举为效率绩效、规模绩效中系数中文名称
///// 对应表cof_director中JobTitle 全文字匹配
///// </summary>
//public enum DirectorType
//{
// 临床科室主任,
// 临床科室副主任,
// 医技科室主任,
// 医技科室副主任,
// 临床科室护士长,
//}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class PerDataAccount : IPerData
{
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 核算单元医生数量
/// </summary>
public Nullable<decimal> Number { get; set; }
/// <summary>
/// 医生基础系数
/// </summary>
public Nullable<decimal> BasicFactor { get; set; }
/// <summary>
/// 倾斜系数
/// </summary>
public Nullable<decimal> SlopeFactor { get; set; }
/// <summary>
/// 其他绩效1
/// </summary>
public Nullable<decimal> OtherPerfor1 { get; set; }
/// <summary>
/// 其他绩效2
/// </summary>
public Nullable<decimal> OtherPerfor2 { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public Nullable<decimal> Extra { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public Nullable<decimal> ScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> AdjustFactor { get; set; }
/// <summary>
/// 科室业绩
/// </summary>
public Nullable<decimal> Income { get; set; }
/// <summary>
/// 业绩绩效
/// </summary>
public Nullable<decimal> PerforFee { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public Nullable<decimal> WorkloadFee { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public Nullable<decimal> PerforTotal { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public Nullable<decimal> Avg { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public Nullable<decimal> RealGiveFee { get; set; }
}
}
//using System;
//using System.Collections.Generic;
//using System.Text;
//namespace Performance.DtoModels
//{
// public class PerDataAccount : IPerData
// {
// public int UnitType;
// /// <summary>
// /// 核算单元
// /// </summary>
// public string AccountingUnit { get; set; }
// /// <summary>
// /// 科室
// /// </summary>
// public string Department { get; set; }
// /// <summary>
// /// 核算单元医生数量
// /// </summary>
// public Nullable<decimal> Number { get; set; }
// /// <summary>
// /// 医生基础系数
// /// </summary>
// public Nullable<decimal> BasicFactor { get; set; }
// /// <summary>
// /// 倾斜系数
// /// </summary>
// public Nullable<decimal> SlopeFactor { get; set; }
// /// <summary>
// /// 其他绩效1
// /// </summary>
// public Nullable<decimal> OtherPerfor1 { get; set; }
// /// <summary>
// /// 其他绩效2
// /// </summary>
// public Nullable<decimal> OtherPerfor2 { get; set; }
// /// <summary>
// /// 医院奖罚
// /// </summary>
// public Nullable<decimal> Extra { get; set; }
// /// <summary>
// /// 考核对分率
// /// </summary>
// public Nullable<decimal> ScoringAverage { get; set; }
// /// <summary>
// /// 调节系数
// /// </summary>
// public Nullable<decimal> AdjustFactor { get; set; }
// /// <summary>
// /// 科室业绩
// /// </summary>
// public Nullable<decimal> Income { get; set; }
// /// <summary>
// /// 业绩绩效
// /// </summary>
// public Nullable<decimal> PerforFee { get; set; }
// /// <summary>
// /// 工作量绩效
// /// </summary>
// public Nullable<decimal> WorkloadFee { get; set; }
// /// <summary>
// /// 绩效合计
// /// </summary>
// public Nullable<decimal> PerforTotal { get; set; }
// /// <summary>
// /// 人均绩效
// /// </summary>
// public Nullable<decimal> Avg { get; set; }
// /// <summary>
// /// 实发绩效
// /// </summary>
// public Nullable<decimal> RealGiveFee { get; set; }
// }
//}
......@@ -7,14 +7,26 @@ namespace Performance.DtoModels
public class PerDataAccountBaisc : IPerData
{
/// <summary>
/// 核算单元(医生组)
/// 行号
/// </summary>
public int RowNumber { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
#region EXCEL读取
/// <summary>
/// 核算单元类别 1 医生组 2护理组 3医技组
/// </summary>
public string DoctorAccountingUnit { get; set; }
public string UnitType { get; set; }
/// <summary>
/// 核算单元(护理组)
/// 核算单元
/// </summary>
public string NurseAccountingUnit { get; set; }
public string AccountingUnit { get; set; }
/// <summary>
/// 科室名称
......@@ -22,125 +34,123 @@ public class PerDataAccountBaisc : IPerData
public string Department { get; set; }
/// <summary>
/// 科主任数量
/// 定科人数
/// </summary>
public decimal DoctorDirectorNumber { get; set; }
public decimal PermanentStaff { get; set; }
/// <summary>
/// 科主任/护士长数量
/// </summary>
public decimal ManagerNumber { get; set; }
/// <summary>
/// 核算单元医生数量
/// </summary>
public decimal DoctorNumber { get; set; }
public decimal Number { get; set; }
/// <summary>
/// 医生基础系数
/// </summary>
public decimal DoctorBasicFactor { get; set; }
public decimal BasicFactor { get; set; }
/// <summary>
/// 倾斜系数
/// </summary>
public decimal DoctorSlopeFactor { get; set; }
public decimal SlopeFactor { get; set; }
/// <summary>
/// 其他绩效1
/// </summary>
public decimal DoctorOtherPerfor1 { get; set; }
public decimal OtherPerfor1 { get; set; }
/// <summary>
/// 其他绩效2
/// </summary>
public decimal DoctorOtherPerfor2 { get; set; }
public decimal OtherPerfor2 { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public decimal DoctorExtra { get; set; }
public decimal Extra { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public decimal DoctorScoringAverage { get; set; }
public decimal ScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public decimal DoctorAdjustFactor { get; set; }
public decimal AdjustFactor { get; set; }
/// <summary>
/// 护士长人
/// 规模绩效系
/// </summary>
public decimal NurseHeadNumber { get; set; }
public decimal Scale { get; set; }
/// <summary>
/// 核算单元护士数量
/// 效率绩效系数
/// </summary>
public decimal NurseNumber { get; set; }
public decimal Effic { get; set; }
/// <summary>
/// 护理基础系数
/// 发放系数
/// </summary>
public decimal NurseBasicFactor { get; set; }
public decimal Grant { get; set; }
/// <summary>
/// 护理倾斜系数
/// 保底绩效参考标准
/// </summary>
public decimal NurseSlopeFactor { get; set; }
public string MinimumReference { get; set; }
/// <summary>
/// 其他绩效1
/// 保底绩效系数
/// </summary>
public decimal NurseOtherPerfor1 { get; set; }
public Nullable<decimal> MinimumFactor { get; set; }
/// <summary>
/// 其他绩效2
/// 工作量倾斜系数
/// </summary>
public decimal NurseOtherPerfor2 { get; set; }
public Nullable<decimal> WorkSlopeFactor { get; set; }
#endregion
/// <summary>
/// 医院奖罚
/// </summary>
public decimal NurseExtra { get; set; }
#region 由计算得出
/// <summary>
/// 考核对分率
/// </summary>
public decimal NurseScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public decimal NurseAdjustFactor { get; set; }
/// <summary>
/// 行号
/// 保底绩效金额
/// </summary>
public int RowNumber { get; set; }
public Nullable<decimal> MinimumFee { get; set; }
/// <summary>
/// 规模绩效系数
/// 科室业绩
/// </summary>
public Nullable<decimal> DoctorScale { get; set; }
public Nullable<decimal> Income { get; set; }
/// <summary>
/// 效率绩效系数
/// 业绩绩效
/// </summary>
public Nullable<decimal> DoctorEffic { get; set; }
public Nullable<decimal> PerforFee { get; set; }
/// <summary>
/// 发放系数
/// 工作量绩效
/// </summary>
public Nullable<decimal> DoctorGrant { get; set; }
public Nullable<decimal> WorkloadFee { get; set; }
/// <summary>
/// 规模绩效系数
/// 绩效合计
/// </summary>
public Nullable<decimal> NurseScale { get; set; }
public Nullable<decimal> PerforTotal { get; set; }
/// <summary>
/// 效率绩效系数
/// 人均绩效
/// </summary>
public Nullable<decimal> NurseEffic { get; set; }
public Nullable<decimal> Avg { get; set; }
/// <summary>
/// 发放系数
/// 实发绩效
/// </summary>
public Nullable<decimal> NurseGrant { get; set; }
public Nullable<decimal> RealGiveFee { get; set; }
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Text;
//using System;
//using System.Collections.Generic;
//using System.Text;
namespace Performance.DtoModels
{
public class PerDataAccountDoctor : IPerData
{
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
//namespace Performance.DtoModels
//{
// public class PerDataAccountDoctor : IPerData
// {
// public int UnitType { get; set; }
// /// <summary>
// /// 核算单元
// /// </summary>
// public string AccountingUnit { get; set; }
/// <summary>
/// 科室名称
/// </summary>
public string Department { get; set; }
// /// <summary>
// /// 科室名称
// /// </summary>
// public string Department { get; set; }
/// <summary>
/// 核算单元医生数量
/// </summary>
public decimal Number { get; set; }
// /// <summary>
// /// 核算单元医生数量
// /// </summary>
// public decimal Number { get; set; }
/// <summary>
/// 医生基础系数
/// </summary>
public decimal BasicFactor { get; set; }
// /// <summary>
// /// 医生基础系数
// /// </summary>
// public decimal BasicFactor { get; set; }
/// <summary>
/// 倾斜系数
/// </summary>
public decimal SlopeFactor { get; set; }
// /// <summary>
// /// 倾斜系数
// /// </summary>
// public decimal SlopeFactor { get; set; }
/// <summary>
/// 其他绩效1
/// </summary>
public decimal OtherPerfor1 { get; set; }
// /// <summary>
// /// 其他绩效1
// /// </summary>
// public decimal OtherPerfor1 { get; set; }
/// <summary>
/// 其他绩效2
/// </summary>
public decimal OtherPerfor2 { get; set; }
// /// <summary>
// /// 其他绩效2
// /// </summary>
// public decimal OtherPerfor2 { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public decimal Extra { get; set; }
// /// <summary>
// /// 医院奖罚
// /// </summary>
// public decimal Extra { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public decimal ScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public decimal AdjustFactor { get; set; }
// /// <summary>
// /// 考核对分率
// /// </summary>
// public decimal ScoringAverage { get; set; }
// /// <summary>
// /// 调节系数
// /// </summary>
// public decimal AdjustFactor { get; set; }
/// <summary>
/// 科室业绩
/// </summary>
public decimal Income { get; set; }
// /// <summary>
// /// 科室业绩
// /// </summary>
// public decimal Income { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public decimal WorkloadFee { get; set; }
// /// <summary>
// /// 工作量绩效
// /// </summary>
// public decimal WorkloadFee { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public decimal PerforTotal { get; set; }
// /// <summary>
// /// 绩效合计
// /// </summary>
// public decimal PerforTotal { get; set; }
/// <summary>
/// 业绩绩效
/// </summary>
public decimal PerforFee { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public decimal RealGiveFee { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public decimal Avg { get; set; }
}
}
// /// <summary>
// /// 业绩绩效
// /// </summary>
// public decimal PerforFee { get; set; }
// /// <summary>
// /// 实发绩效
// /// </summary>
// public decimal RealGiveFee { get; set; }
// /// <summary>
// /// 人均绩效
// /// </summary>
// public decimal Avg { get; set; }
// }
//}
using System;
using System.Collections.Generic;
using System.Text;
//using System;
//using System.Collections.Generic;
//using System.Text;
namespace Performance.DtoModels
{
public class PerDataAccountNurse : IPerData
{
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
//namespace Performance.DtoModels
//{
// public class PerDataAccountNurse : IPerData
// {
// public int UnitType { get; set; }
// /// <summary>
// /// 核算单元
// /// </summary>
// public string AccountingUnit { get; set; }
/// <summary>
/// 科室名称
/// </summary>
public string Department { get; set; }
// /// <summary>
// /// 科室名称
// /// </summary>
// public string Department { get; set; }
/// <summary>
/// 核算单元护士数量
/// </summary>
public decimal Number { get; set; }
// /// <summary>
// /// 核算单元护士数量
// /// </summary>
// public decimal Number { get; set; }
/// <summary>
/// 护理基础系数
/// </summary>
public decimal BasicFactor { get; set; }
// /// <summary>
// /// 护理基础系数
// /// </summary>
// public decimal BasicFactor { get; set; }
/// <summary>
/// 护理倾斜系数
/// </summary>
public decimal SlopeFactor { get; set; }
// /// <summary>
// /// 护理倾斜系数
// /// </summary>
// public decimal SlopeFactor { get; set; }
/// <summary>
/// 其他绩效1
/// </summary>
public decimal OtherPerfor1 { get; set; }
// /// <summary>
// /// 其他绩效1
// /// </summary>
// public decimal OtherPerfor1 { get; set; }
/// <summary>
/// 其他绩效2
/// </summary>
public decimal OtherPerfor2 { get; set; }
// /// <summary>
// /// 其他绩效2
// /// </summary>
// public decimal OtherPerfor2 { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public decimal Extra { get; set; }
// /// <summary>
// /// 医院奖罚
// /// </summary>
// public decimal Extra { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public decimal ScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public decimal AdjustFactor { get; set; }
// /// <summary>
// /// 考核对分率
// /// </summary>
// public decimal ScoringAverage { get; set; }
// /// <summary>
// /// 调节系数
// /// </summary>
// public decimal AdjustFactor { get; set; }
/// <summary>
/// 科室业绩
/// </summary>
public decimal Income { get; set; }
// /// <summary>
// /// 科室业绩
// /// </summary>
// public decimal Income { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public decimal WorkloadFee { get; set; }
// /// <summary>
// /// 工作量绩效
// /// </summary>
// public decimal WorkloadFee { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public decimal PerforTotal { get; set; }
// /// <summary>
// /// 绩效合计
// /// </summary>
// public decimal PerforTotal { get; set; }
/// <summary>
/// 业绩绩效
/// </summary>
public decimal PerforFee { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public decimal RealGiveFee { get; set; }
// /// <summary>
// /// 业绩绩效
// /// </summary>
// public decimal PerforFee { get; set; }
// /// <summary>
// /// 实发绩效
// /// </summary>
// public decimal RealGiveFee { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public decimal Avg { get; set; }
}
}
// /// <summary>
// /// 人均绩效
// /// </summary>
// public decimal Avg { get; set; }
// }
//}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class PerDataClinicEmployee : IPerData
{
/// <summary>
/// 核算单元分类
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 科室名称
/// </summary>
public string Department { get; set; }
/// <summary>
/// 人员工号
/// </summary>
public string PersonnelNumber { get; set; }
/// <summary>
/// 医生姓名
/// </summary>
public string DoctorName { get; set; }
/// <summary>
/// 职称
/// </summary>
public string JobTitle { get; set; }
/// <summary>
/// 基础绩效系数
/// </summary>
public Nullable<decimal> Basics { get; set; }
/// <summary>
/// 岗位系数
/// </summary>
public Nullable<decimal> PostCoefficient { get; set; }
/// <summary>
/// 效率绩效系数
/// </summary>
public Nullable<decimal> Efficiency { get; set; }
/// <summary>
/// 规模绩效系数
/// </summary>
public Nullable<decimal> Scale { get; set; }
/// <summary>
/// 管理绩效发放系数
/// </summary>
public Nullable<decimal> Management { get; set; }
/// <summary>
/// 参加工作时间
/// </summary>
public Nullable<DateTime> WorkTime { get; set; }
/// <summary>
/// 考核得分率
/// </summary>
public Nullable<decimal> ScoreAverageRate { get; set; }
/// <summary>
/// 出勤率
/// </summary>
public Nullable<decimal> Attendance { get; set; }
/// <summary>
/// 其他绩效
/// </summary>
public Nullable<decimal> OthePerfor { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public Nullable<decimal> Punishment { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> Adjust { get; set; }
/// <summary>
/// 行号
/// </summary>
public int RowNumber { get; set; }
}
}
......@@ -32,6 +32,11 @@ public class PerDataEmployee : IPerData
public string AccountType { get; set; }
/// <summary>
/// 人员工号
/// </summary>
public string PersonnelNumber { get; set; }
/// <summary>
/// 医生姓名
/// </summary>
public string DoctorName { get; set; }
......
......@@ -56,5 +56,20 @@ public class PerDataSpecialUnit : IPerData
/// </summary>
public Nullable<decimal> Adjust { get; set; }
public int RowNumber { get; set; }
/// <summary>
/// 效率绩效系数
/// </summary>
public Nullable<decimal> Efficiency { get; set; }
/// <summary>
/// 规模绩效系数
/// </summary>
public Nullable<decimal> Scale { get; set; }
/// <summary>
/// 管理绩效发放系数
/// </summary>
public Nullable<decimal> Management { get; set; }
}
}
......@@ -4,6 +4,11 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>..\Performance.Api\wwwroot\Performance.DtoModels.xml</DocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Remove="PerExcel\PerComputeData.cs" />
</ItemGroup>
......
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ReportData
{
public ReportData(rep_report report)
{
ReportID = report.ID;
ChartType = report.ChartType;
Sort = report.Sort;
Title = report.Title;
XTitle = report.XTitle;
XUnit = report.XUnit;
YTitle = report.YTitle;
YUnit = report.YUnit;
VTitle = report.VTitle;
VUnit = report.VUnit;
NTitle = report.NTitle;
NUnit = report.NUnit;
Formula = report.Formula;
DataType = report.DataType;
FilterValue = report.FilterValue;
ChartData = new List<ChartData>();
}
public int ReportID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> ChartType { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> Sort { get; set; }
/// <summary>
/// 报表标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// X轴标题
/// </summary>
public string XTitle { get; set; }
/// <summary>
/// X轴单位
/// </summary>
public string XUnit { get; set; }
/// <summary>
/// Y轴标题
/// </summary>
public string YTitle { get; set; }
/// <summary>
/// Y轴单位
/// </summary>
public string YUnit { get; set; }
/// <summary>
/// 值标题
/// </summary>
public string VTitle { get; set; }
/// <summary>
/// 值单位
/// </summary>
public string VUnit { get; set; }
/// <summary>
/// name标题
/// </summary>
public string NTitle { get; set; }
/// <summary>
/// name单位
/// </summary>
public string NUnit { get; set; }
/// <summary>
/// 图表说明
/// </summary>
public string Formula { get; set; }
/// <summary>
/// 1表示需要进行小于百分2的类型进行合并
/// </summary>
public Nullable<int> DataType { get; set; }
/// <summary>
/// 图标value过滤执值
/// </summary>
public Nullable<decimal> FilterValue { get; set; }
/// <summary>
/// 图表数据
/// </summary>
public List<ChartData> ChartData { get; set; }
}
/// <summary>
/// 图表
/// </summary>
public class ChartData
{
/// <summary>
/// X轴内容
/// </summary>
public string X { get; set; }
/// <summary>
/// Y轴内容
/// </summary>
public string Y { get; set; }
/// <summary>
/// 分类
/// </summary>
public string Name { get; set; }
/// <summary>
/// 值
/// </summary>
public Double Value { get; set; }
/// <summary>
/// 总量
/// </summary>
public Double? Total { get; set; }
/// <summary>
/// ChartData 类型标签
/// </summary>
public string Type { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace Performance.DtoModels
{
/// <summary>
/// 菜单条件状态
/// </summary>
public enum SelectionState
{
/// <summary>
/// 1 可用并显示
/// </summary>
[Description("可用并显示")]
UsableAndDispaly = 1,
/// <summary>
/// 2 可用但不显示
/// </summary>
[Description("可用但不显示")]
UsableAndNotDispaly = 2,
/// <summary>
/// 3 不显示不可用
/// </summary>
[Description("不显示不可用")]
NotUsableAndNotDispaly = 3,
/// <summary>
/// 4 显示不可用
/// </summary>
[Description("显示但不可用")]
NotUsableAndDispaly = 4
}
/// <summary>
/// 条件加载方式
/// </summary>
public enum LoadType
{
/// <summary>
/// 1 立即加载
/// </summary>
InstantLoad = 1,
/// <summary>
/// 2 联动加载
/// </summary>
LinkageLoad = 2,
/// <summary>
/// 3 自动补全
/// </summary>
AutoComplete = 3,
}
/// <summary>
/// SQL操作符
/// </summary>
public enum SQLOperator
{
/// <summary>
/// Equal
/// </summary>
[Description("Equal")]
Equal = 1,
/// <summary>
/// Like
/// </summary>
[Description("Like")]
Like = 2,
/// <summary>
/// In
/// </summary>
[Description("In")]
In = 3,
/// <summary>
/// Not Like
/// </summary>
[Description("Not Like")]
NotLike = 4,
/// <summary>
/// Not In
/// </summary>
[Description("Not In")]
NotIn = 5,
}
}
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class AgOtherRequest
{
public int SecondId { get; set; }
public List<ag_othersource> Othersources { get; set; }
}
}
......@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary>
/// 二次分配请求
/// </summary>
public class AgainAllotRequest : ApiRequest
public class AgainAllotRequest
{
/// <summary>
/// 二次分配ID
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class AllotDeptRequest
{
public int AllotId { get; set; }
public int HospitalId { get; set; }
public string Department { get; set; }
}
}
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class AllotRequest : ApiRequest
public class AllotRequest
{
public int ID { get; set; }
......
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class AssessColumnRequest : ApiRequest
public class AssessColumnRequest
{
public int ColumnID { get; set; }
public int AssessID { get; set; }
......
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class AssessDataRequest : ApiRequest
public class AssessDataRequest
{
public int AssessID { get; set; }
public List<AssessRow> AssessRow { get; set; }
......
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class AssessRequest : ApiRequest
public class AssessRequest
{
public int AssessID { get; set; }
public int AllotID { get; set; }
......
using System;
using FluentValidation;
using FluentValidation;
using System;
namespace Performance.DtoModels
{
public class CofAgainRequest: ApiRequest
public class CofAgainRequest
{
public int ID { get; set; }
......@@ -13,6 +13,11 @@ public class CofAgainRequest: ApiRequest
public int AllotID { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 1 职称绩效 2 工作量绩效 3 满勤天数
/// </summary>
public int Type { get; set; }
......
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class ComputerRequest : ApiRequest
public class ComputerRequest
{
/// <summary>
/// 绩效数据id
......
......@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary>
/// 查看科室绩效详情
/// </summary>
public class DeptDetailRequest : ApiRequest
public class DeptDetailRequest
{
/// <summary>
/// 绩效id
......@@ -16,6 +16,11 @@ public class DeptDetailRequest : ApiRequest
public int AllotId { get; set; }
/// <summary>
/// 二次绩效id
/// </summary>
public int SecondId { get; set; }
/// <summary>
/// 绩效类型(1 医生组、 2 护理组)
/// </summary>
public int Type { get; set; }
......@@ -29,9 +34,9 @@ public class DetailRequestValidator : AbstractValidator<DeptDetailRequest>
{
public DetailRequestValidator()
{
RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleFor(x => x.Type).NotNull().InclusiveBetween(1, 2);
RuleFor(x => x.AccountID).NotNull().GreaterThan(0);
//RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
//RuleFor(x => x.Type).NotNull().InclusiveBetween(1, 5);
//RuleFor(x => x.AccountID).NotNull().GreaterThan(0);
}
}
}
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class DirectorRequest : ApiRequest
public class DirectorRequest
{
public int ID { get; set; }
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class DownRequest
{
public int TempType { get; set; }
}
}
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class DrugpropRequest : ApiRequest
public class DrugpropRequest
{
public int ID { get; set; }
......@@ -26,6 +26,10 @@ public class DrugpropRequest : ApiRequest
/// 费用名称
/// </summary>
public string Charge { get; set; }
/// <summary>
/// 费用类别
/// </summary>
public string ChargeType { get; set; }
public class DrugpropRequestValidator : AbstractValidator<DrugpropRequest>
......
......@@ -115,7 +115,7 @@ public EmployeeRequestValidator()
};
RuleSet("Select", () =>
{
RuleFor(x => x.AllotID).NotNull().GreaterThan(0);
//RuleFor(x => x.AllotID).NotNull().GreaterThan(0);
});
RuleSet("Insert", () =>
......
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ExtractRequest
{
/// <summary>
/// 绩效ID
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public int HospitalId { get; set; }
/// <summary>
/// 使用方案
/// </summary>
public int UseScheme { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; set; }
}
public class ExtractRequestValidator : AbstractValidator<ExtractRequest>
{
public ExtractRequestValidator()
{
RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
//RuleFor(x => x.UseScheme).NotNull().InclusiveBetween(1, 2);
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class FixatItemRequest
{
public int AllotId { get; set; }
public int SecondId { get; set; }
public string UnitType { get; set; }
public List<FixatItem> FixatItems { get; set; }
public int RowNumber { get; set; }
}
public class FixatItemRequestValidator : AbstractValidator<FixatItemRequest>
{
public FixatItemRequestValidator()
{
RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleFor(x => x.SecondId).NotNull().GreaterThan(0);
RuleFor(x => x.UnitType).NotNull().NotEmpty();
}
}
public class FixatItem
{
public int FixatId { get; set; }
public string ItemName { get; set; }
public decimal ItemValue { get; set; }
public decimal FactorValue { get; set; }
public decimal Sort { get; set; }
public int Type { get; set; }
public int SourceType { get; set; }
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class GuaranteeRequest
{
/// <summary> </summary>
public int Id { get; set; }
/// <summary> </summary>
public int AllotId { get; set; }
/// <summary> 优先级 </summary>
public int Priority { get; set; }
/// <summary> 核算单元类型 1 医生组 2 护理组 3 医技组 </summary>
public Nullable<int> UnitType { get; set; }
/// <summary> 保底科室 </summary>
public string Target { get; set; }
/// <summary> 保底来源科室 </summary>
public List<GuaranItems> Source { get; set; }
}
public class GuaranteeRequestValidator : AbstractValidator<GuaranteeRequest>
{
public GuaranteeRequestValidator()
{
RuleSet("Select", () =>
{
RuleFor(x => x.AllotId).NotNull().NotEmpty().GreaterThan(0);
});
RuleSet("Insert", () =>
{
RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleFor(x => x.Priority).NotNull().GreaterThan(0);
});
//RuleSet("Update", () =>
//{
// RuleFor(x => x.Id).NotNull().GreaterThan(0);
//});
RuleSet("Delete", () =>
{
RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleFor(x => x.Priority).NotNull().GreaterThan(0);
RuleFor(x => x.UnitType).NotNull().GreaterThan(0);
RuleFor(x => x.Target).NotEmpty();
});
}
}
}
......@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary>
/// 登录请求
/// </summary>
public class HospitalRequest : ApiRequest
public class HospitalRequest
{
public int ID { get; set; }
/// <summary>
......@@ -38,19 +38,19 @@ public class HospitalRequest : ApiRequest
/// <summary>
/// 是否开启年资系数 1 启用 2 禁用
/// </summary>
public Nullable<int> IsOpenWorkYear { get; set; }
//public Nullable<int> IsOpenWorkYear { get; set; }
/// <summary>
/// 是否开启药占比系数 1 启用 2 禁用
/// </summary>
public Nullable<int> IsOpenDrugprop { get; set; }
/// <summary>
/// 是否开启ICU有效收入系数 1 启用 2 禁用
/// </summary>
public Nullable<int> IsOpenIncome { get; set; }
/// <summary>
/// 是否开启规模/效率绩效 1 启用 2 禁用
/// </summary>
public Nullable<int> IsOpenDirector { get; set; }
///// <summary>
///// 是否开启ICU有效收入系数 1 启用 2 禁用
///// </summary>
//public Nullable<int> IsOpenIncome { get; set; }
///// <summary>
///// 是否开启规模/效率绩效 1 启用 2 禁用
///// </summary>
//public Nullable<int> IsOpenDirector { get; set; }
}
public class HospitalRequestValidator : AbstractValidator<HospitalRequest>
......@@ -60,10 +60,10 @@ public HospitalRequestValidator()
Action action = () =>
{
RuleFor(x => x.HosName).NotNull().NotEmpty().Length(1, 50);
RuleFor(x => x.AreaCode).NotNull().NotEmpty().Length(1, 50);
//RuleFor(x => x.AreaCode).NotNull().NotEmpty().Length(1, 50);
RuleFor(x => x.HosLevel).NotNull().NotEmpty().Length(1, 50);
RuleFor(x => x.HosType).NotNull().NotEmpty().Length(1, 50);
RuleFor(x => x.IsOpenWorkYear).NotNull().InclusiveBetween(1, 2);
//RuleFor(x => x.IsOpenWorkYear).NotNull().InclusiveBetween(1, 2);
};
RuleSet("Insert", () =>
......
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class IncomeRequest : ApiRequest
public class IncomeRequest
{
public int ID { get; set; }
......
......@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary>
/// 登录请求
/// </summary>
public class LoginRequest : ApiRequest
public class LoginRequest
{
/// <summary>
/// 登录类型 1 手机号登录 2 账号登录
......@@ -16,6 +16,8 @@ public class LoginRequest : ApiRequest
public int LoginType { get; set; }
public string Account { get; set; }
public string Password { get; set; }
public string AppName { get; set; }
public string Device { get; set; }
}
public class LoginRequestValidator : AbstractValidator<LoginRequest>
......
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ModItemRequest
{
/// <summary>
///
/// </summary>
public Nullable<int> ModuleId { get; set; }
/// <summary>
/// 绩效考核项id
/// </summary>
public Nullable<int> ItemId { get; set; }
/// <summary>
/// 绩效考核项
/// </summary>
public string ItemName { get; set; }
}
public class ItemListRequest
{
/// <summary> 方案Id </summary>
public Nullable<int> ModuleId { get; set; }
/// <summary> 新增项 </summary>
public List<mod_item> Items { get; set; }
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ModModuleRequest
{
/// <summary> 绩效模块Id </summary>
public Nullable<int> ModuleId { get; set; }
/// <summary> 医院Id </summary>
public Nullable<int> HospitalId { get; set; }
public Nullable<int> ExtractId { get; set; }
/// <summary>
/// 数据库地址
/// </summary>
public Nullable<int> ConfigId { get; set; }
/// <summary> 类型 </summary>
public Nullable<int> SheetType { get; set; }
/// <summary> 绩效模块 </summary>
public string ModuleName { get; set; }
/// <summary> 描述 </summary>
public string Description { get; set; }
/// <summary>
/// 当前脚本类型 1 收入整表 2 单项数据提取
/// </summary>
public List<int> ExecuteType { get; set; }
public int PageNum { get; set; }
public int PageSize { get; set; }
}
public class ModModuleRequestValidator : AbstractValidator<ModModuleRequest>
{
public ModModuleRequestValidator()
{
RuleSet("Query", () =>
{
RuleFor(x => x.HospitalId).NotNull().NotEmpty().GreaterThan(0);
});
RuleSet("Add", () =>
{
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.ModuleName).NotNull().NotEmpty();
RuleFor(x => x.SheetType).NotNull().NotEmpty();
});
RuleSet("Edit", () =>
{
RuleFor(x => x.ModuleId).NotNull().NotEmpty().GreaterThan(0);
});
}
}
}
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ModSpecialRequest
{
/// <summary> 医院Id </summary>
public Nullable<int> HospitalId { get; set; }
/// <summary> 特殊考核项Id </summary>
public Nullable<int> SpecialId { get; set; }
}
public class SpecialListRequest
{
/// <summary> 医院Id </summary>
public int HospitalId { get; set; }
/// <summary> 特殊考核项 </summary>
public List<mod_special> Items { get; set; }
}
}
......@@ -6,7 +6,7 @@
namespace Performance.DtoModels
{
public class PasswordRequest : ApiRequest
public class PasswordRequest
{
/// <summary>
/// 原始密码
......
......@@ -5,7 +5,7 @@
namespace Performance.DtoModels
{
public class PositionRequest : ApiRequest
public class PositionRequest
{
public int ID { get; set; }
......
......@@ -5,11 +5,24 @@
namespace Performance.DtoModels
{
public class ReportRequest : ApiRequest
public class ReportRequest
{
public int HospitalId { get; set; }
/// <summary> 是否为首页 </summary>
public int IsIndex { get; set; }
/// <summary> 是否以年为单位 </summary>
public int OnlyYear { get; set; }
/// <summary> 报表名称 </summary>
public string Source { get; set; }
/// <summary> 年 </summary>
public string Year { get; set; }
/// <summary> 月 </summary>
public string Month { get; set; }
}
public class ReportRequestValidator : AbstractValidator<ReportRequest>
{
......@@ -19,6 +32,19 @@ public ReportRequestValidator()
{
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
});
RuleSet("Index", () =>
{
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.Source).NotNull().NotEmpty();
});
RuleSet("Menu", () =>
{
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.OnlyYear).NotNull();
RuleFor(x => x.Source).NotNull().NotEmpty();
});
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class SecondAuditRequest
{
/// <summary> 二次绩效Id </summary>
public int SecondId { get; set; }
/// <summary> 审核结果 1、审核通过 2、驳回 </summary>
public int IsPass { get; set; }
/// <summary> 备注 </summary>
public string Remark { get; set; }
}
public class SecondAuditRequestValidator : AbstractValidator<SecondAuditRequest>
{
public SecondAuditRequestValidator()
{
RuleFor(x => x.SecondId).NotNull().NotEmpty().GreaterThan(0);
RuleFor(x => x.IsPass).NotNull().NotEmpty().InclusiveBetween(1, 2);
RuleFor(x => x.Remark).NotNull().NotEmpty();
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class HospitalIdRequest
{
public int HospitalId { get; set; }
}
public class SelectionRequest
{
public int GroupId { get; set; }
}
public class SearchReportRequest
{
public int HospitalId { get; set; }
public int GroupId { get; set; }
public int ReportId { get; set; }
public List<SelectionValues> Values { get; set; }
}
public class SelectionValues
{
public string Title { get; set; }
public List<string> Values { get; set; }
}
}
......@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary>
/// 登录请求
/// </summary>
public class SetDepartmentRequest : ApiRequest
public class SetDepartmentRequest
{
public int HospitalID { get; set; }
}
......
......@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary>
/// sheet数据详情请求
/// </summary>
public class SheetExportRequest : ApiRequest
public class SheetExportRequest
{
public int SheetID { get; set; }
......
......@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary>
/// sheet页列表请求
/// </summary>
public class SheetRequest : ApiRequest
public class SheetRequest
{
public int AllotID { get; set; }
......
......@@ -6,7 +6,7 @@
namespace Performance.DtoModels.Request
{
public class SmsCodeRequest : ApiRequest
public class SmsCodeRequest
{
/// <summary>
/// 短信验证类型 1 手机号登录 2 其他
......
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class SubmitAuditRequest
{
public int SecondId { get; set; }
/// <summary>
/// 提交类型 1 模板提交 2 其他提交
/// </summary>
public int Type { get; set; }
}
public class SubmitAuditRequestValidator : AbstractValidator<SubmitAuditRequest>
{
public SubmitAuditRequestValidator()
{
RuleFor(x => x.Type).InclusiveBetween(1, 2);
RuleFor(x => x.SecondId).GreaterThan(0);
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class UseTempRequest
{
public int TempId { get; set; }
public int HospitalId { get; set; }
public string Department { get; set; }
public string UnitType { get; set; }
public int SecondId { get; set; }
/// <summary> 是否归档 </summary>
public int IsArchive { get; set; }
}
public class UseTempRequestValidator : AbstractValidator<UseTempRequest>
{
public UseTempRequestValidator()
{
RuleSet("Use", () =>
{
RuleFor(x => x.TempId).NotNull().GreaterThan(0);
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.Department).NotNull().NotEmpty();
RuleFor(x => x.UnitType).NotNull().NotEmpty();
});
RuleSet("Refresh", () =>
{
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.Department).NotNull().NotEmpty();
RuleFor(x => x.UnitType).NotNull().NotEmpty();
RuleFor(x => x.SecondId).NotNull().GreaterThan(0);
});
}
}
}
......@@ -6,7 +6,7 @@
namespace Performance.DtoModels
{
public class UserRequest : ApiRequest
public class UserRequest
{
public int ID { get; set; }
/// <summary>
......
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class WorkItemRequest
{
public int ID { get; set; }
public int AllotID { get; set; }
/// <summary>
/// 工作量绩效项
/// </summary>
public string Item { get; set; }
public class WorkItemRequestValidator : AbstractValidator<WorkItemRequest>
{
public WorkItemRequestValidator()
{
RuleSet("Select", () =>
{
RuleFor(x => x.AllotID).NotNull().NotEmpty().GreaterThan(0);
});
RuleSet("Insert", () =>
{
RuleFor(x => x.AllotID).NotNull().GreaterThan(0);
});
RuleSet("Update", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
RuleSet("Delete", () =>
{
RuleFor(x => x.ID).NotNull().GreaterThan(0);
});
}
}
}
}
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class WorkloadRequest
{
/// <summary>
/// 绩效ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> HospitalId { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
///
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 工作量名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 工作量系数
/// </summary>
public Nullable<decimal> FactorValue { get; set; }
/// <summary>
///
/// </summary>
public Nullable<decimal> Sort { get; set; }
}
public class WorkloadRequestValidator : AbstractValidator<WorkloadRequest>
{
public WorkloadRequestValidator()
{
RuleSet("Add", () =>
{
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.Department).NotNull().NotEmpty();
RuleFor(x => x.UnitType).NotNull().NotEmpty();
RuleFor(x => x.ItemName).NotNull().NotEmpty();
});
RuleSet("Update", () =>
{
RuleFor(x => x.Id).NotNull().GreaterThan(0);
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.ItemName).NotNull().NotEmpty();
});
RuleSet("Delete", () =>
{
RuleFor(x => x.Id).NotNull().GreaterThan(0);
});
RuleSet("Query", () =>
{
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.Department).NotNull().NotEmpty();
RuleFor(x => x.UnitType).NotNull().NotEmpty();
});
}
}
}
......@@ -6,7 +6,7 @@
namespace Performance.DtoModels
{
public class WorkyearRequest : ApiRequest
public class WorkyearRequest
{
public int ID { get; set; }
......
......@@ -57,5 +57,9 @@ public class AllotResponse
/// 是否可以下载
/// </summary>
public bool IsDown { get; set; }
/// <summary>
/// 3 提取数据
/// </summary>
public int HasConfig { get; set; }
}
}
......@@ -22,6 +22,11 @@ public class ComputeResponse
public string EmployeeName { get; set; }
/// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
/// <summary>
/// 职位
/// </summary>
public string JobTitle { get; set; }
......
......@@ -6,7 +6,7 @@ namespace Performance.DtoModels
{
public class DeptDetailResponse
{
public PerDataAccount Pandect { get; set; }
public PerDataAccountBaisc Pandect { get; set; }
public List<DeptDetail> Economic { get; set; }
public List<DeptDetail> Workload { get; set; }
}
......@@ -16,4 +16,44 @@ public class DeptDetail
public string ItemName { get; set; }
public decimal ItemValue { get; set; }
}
public class DeptDataDetails
{
/// <summary> 概览</summary>
public PerDataAccountBaisc Pandect { get; set; }
/// <summary> 收入明细 </summary>
public List<DetailDtos> Detail { get; set; }
}
public class DetailDtos
{
/// <summary> 收入项名称 </summary>
public string ItemName { get; set; }
/// <summary> 1、收入 2、支出 3、工作量 </summary>
public int IncomeType { get; set; }
/// <summary> 金额 </summary>
public decimal Amount { get; set; }
/// <summary> 详情 </summary>
public List<DetailModule> Items { get; set; }
}
public class DetailModule
{
/// <summary> 明细项 </summary>
public string ItemName { get; set; }
/// <summary> 原始值 </summary>
public decimal? CellValue { get; set; }
/// <summary> 系数 </summary>
public decimal? Factor { get; set; }
/// <summary> 结算值 </summary>
public decimal? ItemValue { get; set; }
}
}
......@@ -4,7 +4,7 @@
namespace Performance.DtoModels
{
public class DoctorResponse
public class DeptResponse
{
/// <summary>
///
......@@ -21,6 +21,8 @@ public class DoctorResponse
/// </summary>
public Nullable<int> SheetID { get; set; }
public int UnitType { get; set; }
/// <summary>
/// 分组名称(医生、护士)
/// </summary>
......@@ -37,6 +39,11 @@ public class DoctorResponse
public string Department { get; set; }
/// <summary>
/// 科主任/护士长数量
/// </summary>
public Nullable<decimal> ManagerNumber { get; set; }
/// <summary>
/// 核算单元医生数量
/// </summary>
public Nullable<decimal> Number { get; set; }
......@@ -52,6 +59,21 @@ public class DoctorResponse
public Nullable<decimal> SlopeFactor { get; set; }
/// <summary>
/// 保底绩效参考标准
/// </summary>
public string MinimumReference { get; set; }
/// <summary>
/// 保底绩效系数
/// </summary>
public Nullable<decimal> MinimumFactor { get; set; }
/// <summary>
/// 保底绩效金额
/// </summary>
public Nullable<decimal> MinimumFee { get; set; }
/// <summary>
/// 其他绩效1
/// </summary>
public Nullable<decimal> OtherPerfor1 { get; set; }
......@@ -105,5 +127,10 @@ public class DoctorResponse
/// 实发绩效
/// </summary>
public Nullable<decimal> RealGiveFee { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class GuaranteeResponse
{
/// <summary>
///
/// </summary>
public Nullable<int> AllotId { get; set; }
/// <summary>
/// 优先级
/// </summary>
public Nullable<int> Priority { get; set; }
/// <summary>
/// 核算单元类型 1 医生组 2 护理组 3 医技组
/// </summary>
public Nullable<int> UnitType { get; set; }
/// <summary>
/// 保底科室
/// </summary>
public string Target { get; set; }
/// <summary>
/// 保底来源科室
/// </summary>
public List<GuaranItems> Source { get; set; }
}
public class GuaranItems
{
public Nullable<int> GId { get; set; }
public string GValue { get; set; }
}
}
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