Commit 12a2b71e by ruyun.zhang@suvalue.com

Merge branch 'dev' into v2020

parents b4cd4e2b 8a51a500
using FluentValidation.AspNetCore; using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
...@@ -11,6 +12,7 @@ ...@@ -11,6 +12,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
...@@ -43,43 +45,73 @@ public class AccountController : Controller ...@@ -43,43 +45,73 @@ public class AccountController : Controller
/// 登录 /// 登录
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[NoVerify]
[HttpPost] [HttpPost]
[Route("login")] [Route("login")]
public ApiResponse<UserIdentity> Login([FromBody]LoginRequest request) [AllowAnonymous]
public ApiResponse<JwtToken> Login([FromBody]LoginRequest request)
{ {
var user = _userService.Login(request); var user = _userService.Login(request);
if (user == null) if (user == null)
return new ApiResponse<UserIdentity>(ResponseType.Fail, "用户不存在"); return new ApiResponse<JwtToken>(ResponseType.Fail, "用户不存在");
int[] roleArray = new int[] { _options.NurseRole, _options.DirectorRole };
user.Hospital = _hospitalService.GetUserHopital(user.UserID); var claims = new Claim[]
user.Role = _roleService.GetUserRole(user.UserID); {
user.IsAgainAdmin = user.Role != null ? roleArray.Contains(user.Role.First().RoleID) : false; 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)) var jwtToken = JwtTokenHelper.GenerateToken(claims, _options.ExpirationMinutes);
user.Token = Guid.NewGuid().ToString("N"); 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>
/// 查询个人信息 /// 查询个人信息
/// </summary> /// </summary>
/// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[Route("selfinfo")] [Route("selfinfo")]
[HttpPost] [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); return new ApiResponse(ResponseType.OK, user);
} }
...@@ -92,7 +124,7 @@ public ApiResponse SelfInfo([FromBody]ApiRequest request) ...@@ -92,7 +124,7 @@ public ApiResponse SelfInfo([FromBody]ApiRequest request)
[HttpPost] [HttpPost]
public ApiResponse<UserResponse> UpdateSelf([CustomizeValidator(RuleSet = "Self"), FromBody]UserRequest request) 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); var user = _userService.UpdateSelf(request);
return new ApiResponse<UserResponse>(ResponseType.OK, user); return new ApiResponse<UserResponse>(ResponseType.OK, user);
} }
...@@ -100,13 +132,12 @@ public ApiResponse<UserResponse> UpdateSelf([CustomizeValidator(RuleSet = "Self" ...@@ -100,13 +132,12 @@ public ApiResponse<UserResponse> UpdateSelf([CustomizeValidator(RuleSet = "Self"
/// <summary> /// <summary>
/// 用户列表 /// 用户列表
/// </summary> /// </summary>
/// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[Route("list")] [Route("list")]
[HttpPost] [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); return new ApiResponse<List<UserResponse>>(ResponseType.OK, "ok", userList);
} }
...@@ -119,8 +150,8 @@ public ApiResponse<List<UserResponse>> List([FromBody]ApiRequest request) ...@@ -119,8 +150,8 @@ public ApiResponse<List<UserResponse>> List([FromBody]ApiRequest request)
[HttpPost] [HttpPost]
public ApiResponse<UserResponse> Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]UserRequest request) public ApiResponse<UserResponse> Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]UserRequest request)
{ {
var userIdentity = _claim.At(request.Token); var userId = _claim.GetUserId();
var user = _userService.Insert(request, userIdentity.UserID); var user = _userService.Insert(request, userId);
user.Role = request.Role; user.Role = request.Role;
return new ApiResponse<UserResponse>(ResponseType.OK, user); return new ApiResponse<UserResponse>(ResponseType.OK, user);
} }
...@@ -146,8 +177,13 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]User ...@@ -146,8 +177,13 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]User
[HttpPost] [HttpPost]
public ApiResponse<UserResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody]UserRequest request) public ApiResponse<UserResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody]UserRequest request)
{ {
var userIdentity = _claim.At(request.Token); var userId = _claim.GetUserId();
var user = _userService.Update(request, userIdentity.IsAgainAdmin);
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; user.Role = request.Role;
return new ApiResponse<UserResponse>(ResponseType.OK, user); return new ApiResponse<UserResponse>(ResponseType.OK, user);
} }
...@@ -161,7 +197,7 @@ public ApiResponse<UserResponse> Update([CustomizeValidator(RuleSet = "Update"), ...@@ -161,7 +197,7 @@ public ApiResponse<UserResponse> Update([CustomizeValidator(RuleSet = "Update"),
[HttpPost] [HttpPost]
public ApiResponse<UserResponse> Password([FromBody]PasswordRequest request) public ApiResponse<UserResponse> Password([FromBody]PasswordRequest request)
{ {
var userid = _claim.At(request.Token).UserID; var userid = _claim.GetUserId();
var user = _userService.UpdatePwd(request, userid); var user = _userService.UpdatePwd(request, userid);
return new ApiResponse<UserResponse>(ResponseType.OK, user); return new ApiResponse<UserResponse>(ResponseType.OK, user);
} }
...@@ -169,13 +205,13 @@ public ApiResponse<UserResponse> Password([FromBody]PasswordRequest request) ...@@ -169,13 +205,13 @@ public ApiResponse<UserResponse> Password([FromBody]PasswordRequest request)
/// <summary> /// <summary>
/// 角色列表 /// 角色列表
/// </summary> /// </summary>
/// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[Route("rolelist")] [Route("rolelist")]
[HttpPost] [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); return new ApiResponse<List<sys_role>>(ResponseType.OK, "ok", roleList);
} }
......
...@@ -29,6 +29,7 @@ namespace Performance.Api.Controllers ...@@ -29,6 +29,7 @@ namespace Performance.Api.Controllers
public class AgainAllotController : Controller public class AgainAllotController : Controller
{ {
private AgainAllotService againAllotService; private AgainAllotService againAllotService;
private RoleService roleService;
private ComputeService computeService; private ComputeService computeService;
private ClaimService claimService; private ClaimService claimService;
private AllotService allotService; private AllotService allotService;
...@@ -36,6 +37,7 @@ public class AgainAllotController : Controller ...@@ -36,6 +37,7 @@ public class AgainAllotController : Controller
private ConfigService configService; private ConfigService configService;
private Application application; private Application application;
public AgainAllotController(AgainAllotService againAllotService, public AgainAllotController(AgainAllotService againAllotService,
RoleService roleService,
ClaimService claimService, ClaimService claimService,
AllotService allotService, AllotService allotService,
IHostingEnvironment env, IHostingEnvironment env,
...@@ -44,6 +46,7 @@ public class AgainAllotController : Controller ...@@ -44,6 +46,7 @@ public class AgainAllotController : Controller
IOptions<Application> options) IOptions<Application> options)
{ {
this.againAllotService = againAllotService; this.againAllotService = againAllotService;
this.roleService = roleService;
this.claimService = claimService; this.claimService = claimService;
this.allotService = allotService; this.allotService = allotService;
this.env = env; this.env = env;
...@@ -58,10 +61,10 @@ public class AgainAllotController : Controller ...@@ -58,10 +61,10 @@ public class AgainAllotController : Controller
/// <returns></returns> /// <returns></returns>
[Route("allotlist")] [Route("allotlist")]
[HttpPost] [HttpPost]
public ApiResponse AllotList([FromBody]ApiRequest request) public ApiResponse AllotList()
{ {
var user = claimService.At(request); var userId = claimService.GetUserId();
var list = againAllotService.GetAllotList(user.UserID); var list = againAllotService.GetAllotList(userId);
return new ApiResponse(ResponseType.OK, list); return new ApiResponse(ResponseType.OK, list);
} }
...@@ -122,19 +125,21 @@ public ApiResponse Import([FromForm] IFormCollection form) ...@@ -122,19 +125,21 @@ public ApiResponse Import([FromForm] IFormCollection form)
[HttpPost] [HttpPost]
public ApiResponse DepartmentDetail([CustomizeValidator(RuleSet = "Generate"), FromBody]AgainAllotRequest request) 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); var again = againAllotService.GetAgainallot(request.AgainAllotID);
if (again == null) if (again == null)
return new ApiResponse(ResponseType.Fail, "当前二次绩效ID无效"); 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); 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.OK, detail);
} }
return new ApiResponse(ResponseType.Fail, "当前用户角色无法识别"); return new ApiResponse(ResponseType.Fail, "当前用户角色无法识别");
...@@ -149,8 +154,9 @@ public ApiResponse DepartmentDetail([CustomizeValidator(RuleSet = "Generate"), F ...@@ -149,8 +154,9 @@ public ApiResponse DepartmentDetail([CustomizeValidator(RuleSet = "Generate"), F
[HttpPost] [HttpPost]
public ApiResponse Generate([CustomizeValidator(RuleSet = "Generate"), FromBody]AgainAllotRequest request) public ApiResponse Generate([CustomizeValidator(RuleSet = "Generate"), FromBody]AgainAllotRequest request)
{ {
var user = claimService.At(request); var userId = claimService.GetUserId();
var result = againAllotService.Generate(request, user); var department = claimService.GetUserClaim(JwtClaimTypes.Department);
var result = againAllotService.Generate(request, userId, department);
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
...@@ -163,8 +169,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Generate"), FromBody] ...@@ -163,8 +169,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Generate"), FromBody]
[HttpPost] [HttpPost]
public ApiResponse Detail([CustomizeValidator(RuleSet = "Generate"), FromBody]AgainAllotRequest request) public ApiResponse Detail([CustomizeValidator(RuleSet = "Generate"), FromBody]AgainAllotRequest request)
{ {
var user = claimService.At(request); var result = againAllotService.Detail(request);
var result = againAllotService.Detail(request, user);
return new ApiResponse(ResponseType.OK, new { result.AgainSituation, result.SheetExport }); return new ApiResponse(ResponseType.OK, new { result.AgainSituation, result.SheetExport });
} }
} }
......
...@@ -29,17 +29,19 @@ public class AllotController : Controller ...@@ -29,17 +29,19 @@ public class AllotController : Controller
private IHostingEnvironment _evn; private IHostingEnvironment _evn;
private ILogger<AllotController> _logger; private ILogger<AllotController> _logger;
private ClaimService _claim; private ClaimService _claim;
private readonly LogManageService logManageService;
public AllotController(AllotService allotService, public AllotController(AllotService allotService,
HospitalService hospitalService, ConfigService configService, HospitalService hospitalService, ConfigService configService,
ILogger<AllotController> logger, IHostingEnvironment evn, ILogger<AllotController> logger, IHostingEnvironment evn,
ClaimService claim) ClaimService claim, LogManageService logManageService)
{ {
_allotService = allotService; _allotService = allotService;
_hospitalService = hospitalService; _hospitalService = hospitalService;
_logger = logger; _logger = logger;
_evn = evn; _evn = evn;
_claim = claim; _claim = claim;
this.logManageService = logManageService;
_configService = configService; _configService = configService;
} }
...@@ -57,6 +59,19 @@ public ApiResponse List([FromBody]AllotRequest request) ...@@ -57,6 +59,19 @@ public ApiResponse List([FromBody]AllotRequest request)
} }
/// <summary> /// <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> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
...@@ -65,8 +80,8 @@ public ApiResponse List([FromBody]AllotRequest request) ...@@ -65,8 +80,8 @@ public ApiResponse List([FromBody]AllotRequest request)
[HttpPost] [HttpPost]
public ApiResponse Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]AllotRequest request) public ApiResponse Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]AllotRequest request)
{ {
var user = _claim.At(request); var userId = _claim.GetUserId();
var result = _allotService.InsertAllot(request, user.UserID); var result = _allotService.InsertAllot(request, userId);
_configService.Copy(result); _configService.Copy(result);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, result);
} }
...@@ -155,9 +170,19 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al ...@@ -155,9 +170,19 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
var allot = _allotService.GetAllot(request.ID); var allot = _allotService.GetAllot(request.ID);
if (null == allot || string.IsNullOrEmpty(allot.Path)) if (null == allot || string.IsNullOrEmpty(allot.Path))
throw new PerformanceException("当前绩效记录不存在或没有上传数据文件"); throw new PerformanceException("当前绩效记录不存在或没有上传数据文件");
var user = _claim.At(request); var email = _claim.GetUserClaim(JwtClaimTypes.Mail);
//_allotService.Generate(allot, user.Mail); if (allot.States == (int)AllotStates.Wait)
BackgroundJob.Enqueue(() => _allotService.Generate(allot, user.Mail)); 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); return new ApiResponse(ResponseType.OK);
} }
...@@ -209,5 +234,37 @@ public ApiResponse AllotCheckResult([CustomizeValidator(RuleSet = "Delete"), Fro ...@@ -209,5 +234,37 @@ public ApiResponse AllotCheckResult([CustomizeValidator(RuleSet = "Delete"), Fro
var list = _allotService.AllotCheckResult(allot); var list = _allotService.AllotCheckResult(allot);
return new ApiResponse(ResponseType.OK, list); 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 ...@@ -129,7 +129,7 @@ public ApiResponse EditAssessData([CustomizeValidator(RuleSet = "Edit"), FromBod
//考核模版列表 //考核模版列表
[HttpPost] [HttpPost]
[Route("tempassesslist")] [Route("tempassesslist")]
public ApiResponse TempAssessList([FromBody]ApiRequest request) public ApiResponse TempAssessList()
{ {
return assessService.TempAssessList(); return assessService.TempAssessList();
} }
......
...@@ -69,13 +69,13 @@ public ApiResponse<List<res_specialunit>> GetSpecial([FromBody]ComputerRequest r ...@@ -69,13 +69,13 @@ public ApiResponse<List<res_specialunit>> GetSpecial([FromBody]ComputerRequest r
/// <returns></returns> /// <returns></returns>
[Route("getdoctordata")] [Route("getdoctordata")]
[HttpPost] [HttpPost]
public ApiResponse<List<DoctorResponse>> GetDoctor([FromBody]ComputerRequest request) public ApiResponse<List<DeptResponse>> GetDoctor([FromBody]ComputerRequest request)
{ {
var allot = _allotService.GetAllot(request.AllotId); var allot = _allotService.GetAllot(request.AllotId);
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetDoctorPerformance(request.AllotId); 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> /// <summary>
...@@ -85,30 +85,55 @@ public ApiResponse<List<DoctorResponse>> GetDoctor([FromBody]ComputerRequest req ...@@ -85,30 +85,55 @@ public ApiResponse<List<DoctorResponse>> GetDoctor([FromBody]ComputerRequest req
/// <returns></returns> /// <returns></returns>
[Route("getnursedata")] [Route("getnursedata")]
[HttpPost] [HttpPost]
public ApiResponse<List<NurseResponse>> GetNurse([FromBody]ComputerRequest request) public ApiResponse<List<DeptResponse>> GetNurse([FromBody]ComputerRequest request)
{ {
var allot = _allotService.GetAllot(request.AllotId); var allot = _allotService.GetAllot(request.AllotId);
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetNursePerformance(request.AllotId); 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>
/// 科室绩效详情 /// 其他组科室绩效列表
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[Route("deptdetail")] [Route("getotherdata")]
[HttpPost] [HttpPost]
public ApiResponse<DeptDetailResponse> DeptDetail([FromBody]DeptDetailRequest request) public ApiResponse<List<DeptResponse>> GetOther([FromBody]ComputerRequest request)
{ {
var allot = _allotService.GetAllot(request.AllotId); var allot = _allotService.GetAllot(request.AllotId);
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); 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); var response = _computeService.DeptDetail(request.AccountID);
return new ApiResponse<DeptDetailResponse>(ResponseType.OK, response); return new ApiResponse<DeptDataDetails>(ResponseType.OK, response);
} }
/// <summary> /// <summary>
...@@ -136,11 +161,12 @@ public ApiResponse AllCompute([FromBody]ComputerRequest request) ...@@ -136,11 +161,12 @@ public ApiResponse AllCompute([FromBody]ComputerRequest request)
[HttpPost] [HttpPost]
public ApiResponse UpdateRealfee([CustomizeValidator(RuleSet = "UpdateReal"), FromBody] ComputerRequest request) 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); var compute = _computeService.GetComputeSingle(request.ComputeId);
if (null == compute) if (null == compute)
throw new PerformanceException("当前数据记录不存在"); throw new PerformanceException("当前数据记录不存在");
compute = _computeService.UpdateRealfee(request, user); compute = _computeService.UpdateRealfee(request, userId, realName);
return new ApiResponse(ResponseType.OK, "修改成功", compute); return new ApiResponse(ResponseType.OK, "修改成功", compute);
} }
......
...@@ -15,9 +15,11 @@ namespace Performance.Api.Controllers ...@@ -15,9 +15,11 @@ namespace Performance.Api.Controllers
public class EmployeeController : Controller public class EmployeeController : Controller
{ {
private EmployeeService employeeService; private EmployeeService employeeService;
public EmployeeController(EmployeeService employeeService) private ClaimService claim;
public EmployeeController(EmployeeService employeeService, ClaimService claim)
{ {
this.employeeService = employeeService; this.employeeService = employeeService;
this.claim = claim;
} }
/// <summary> /// <summary>
...@@ -29,7 +31,7 @@ public EmployeeController(EmployeeService employeeService) ...@@ -29,7 +31,7 @@ public EmployeeController(EmployeeService employeeService)
[HttpPost] [HttpPost]
public ApiResponse GetEmployeeList([CustomizeValidator(RuleSet = "Select"), FromBody]EmployeeRequest request) 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); return new ApiResponse(ResponseType.OK, "ok", employee);
} }
...@@ -72,5 +74,81 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]Empl ...@@ -72,5 +74,81 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]Empl
return new ApiResponse(ResponseType.Fail); return new ApiResponse(ResponseType.Fail);
return new ApiResponse(ResponseType.OK); 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 ...@@ -29,9 +29,9 @@ public HospitalController(HospitalService hospitalService, ClaimService claimSer
/// <returns></returns> /// <returns></returns>
[Route("hospitallist")] [Route("hospitallist")]
[HttpPost] [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); return new ApiResponse<List<HospitalResponse>>(ResponseType.OK, "ok", hospitalList);
} }
...@@ -44,7 +44,7 @@ public ApiResponse<List<HospitalResponse>> GetHospitalList([FromBody]ApiRequest ...@@ -44,7 +44,7 @@ public ApiResponse<List<HospitalResponse>> GetHospitalList([FromBody]ApiRequest
[HttpPost] [HttpPost]
public ApiResponse<HospitalResponse> Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]HospitalRequest request) 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); var hospital = _hospitalService.Insert(request, userid);
_hospitalService.InsertUserHospital(userid, hospital.HosID); _hospitalService.InsertUserHospital(userid, hospital.HosID);
return new ApiResponse<HospitalResponse>(ResponseType.OK, hospital); return new ApiResponse<HospitalResponse>(ResponseType.OK, hospital);
...@@ -62,13 +62,13 @@ public ApiResponse<HospitalResponse> Update([CustomizeValidator(RuleSet = "Updat ...@@ -62,13 +62,13 @@ public ApiResponse<HospitalResponse> Update([CustomizeValidator(RuleSet = "Updat
var hospital = _hospitalService.Update(request); var hospital = _hospitalService.Update(request);
return new ApiResponse<HospitalResponse>(ResponseType.OK, hospital); return new ApiResponse<HospitalResponse>(ResponseType.OK, hospital);
} }
/// <summary> /// <summary>
/// 删除医院 /// 删除医院
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[Disable] [ApiDisable]
[Route("delete")] [Route("delete")]
[HttpPost] [HttpPost]
public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]HospitalRequest request) public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]HospitalRequest request)
......
...@@ -32,9 +32,9 @@ public MenuController(MenuService menuService, ClaimService claimService) ...@@ -32,9 +32,9 @@ public MenuController(MenuService menuService, ClaimService claimService)
/// <returns></returns> /// <returns></returns>
[Route("menulist")] [Route("menulist")]
[HttpPost] [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); return new ApiResponse<List<MenuResponse>>(ResponseType.OK, menuList);
} }
} }
......
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels; using Performance.DtoModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -12,6 +13,7 @@ public class NotFoundController : ControllerBase ...@@ -12,6 +13,7 @@ public class NotFoundController : ControllerBase
{ {
[Route("error/404")] [Route("error/404")]
[HttpGet] [HttpGet]
[AllowAnonymous]
public ActionResult<ApiResponse> Get() public ActionResult<ApiResponse> Get()
{ {
return new ApiResponse(ResponseType.NotFound, "not found"); return new ApiResponse(ResponseType.NotFound, "not found");
......
...@@ -9,22 +9,73 @@ ...@@ -9,22 +9,73 @@
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
{ {
[Route("api/[controller]")] /// <summary>
/// 报表
/// </summary>
[Route("api/report")]
public class ReportController : Controller public class ReportController : Controller
{ {
private AllotService allotService;
private ReportService reportService; private ReportService reportService;
private ReportDataService reportDataService;
private ClaimService claimService; 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.reportService = reportService;
this.reportDataService = reportDataService;
this.claimService = claimService; 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>
/// 首页数据概况 /// 首页数据概况
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("survey")] [Route("survey")]
[HttpPost]
public ApiResponse Survey([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request) public ApiResponse Survey([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{ {
var result = reportService.Survey(request.HospitalId); var result = reportService.Survey(request.HospitalId);
...@@ -36,6 +87,7 @@ public ApiResponse Survey([CustomizeValidator(RuleSet = "Query"), FromBody]Repor ...@@ -36,6 +87,7 @@ public ApiResponse Survey([CustomizeValidator(RuleSet = "Query"), FromBody]Repor
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("doctoravg")] [Route("doctoravg")]
[HttpPost]
public ApiResponse DoctorAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request) public ApiResponse DoctorAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{ {
var result = reportService.DoctorAvg(request.HospitalId, request.IsIndex); var result = reportService.DoctorAvg(request.HospitalId, request.IsIndex);
...@@ -47,6 +99,7 @@ public ApiResponse DoctorAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Re ...@@ -47,6 +99,7 @@ public ApiResponse DoctorAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Re
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("nurseavg")] [Route("nurseavg")]
[HttpPost]
public ApiResponse NurseAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request) public ApiResponse NurseAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{ {
var result = reportService.NurseAvg(request.HospitalId, request.IsIndex); var result = reportService.NurseAvg(request.HospitalId, request.IsIndex);
...@@ -58,6 +111,7 @@ public ApiResponse NurseAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Rep ...@@ -58,6 +111,7 @@ public ApiResponse NurseAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Rep
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("outfeeavg")] [Route("outfeeavg")]
[HttpPost]
public ApiResponse OutFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request) public ApiResponse OutFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{ {
var list = reportService.OutFeeAvg(request.HospitalId); var list = reportService.OutFeeAvg(request.HospitalId);
...@@ -69,6 +123,7 @@ public ApiResponse OutFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Re ...@@ -69,6 +123,7 @@ public ApiResponse OutFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]Re
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("inpatfeeavg")] [Route("inpatfeeavg")]
[HttpPost]
public ApiResponse InpatFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request) public ApiResponse InpatFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{ {
var list = reportService.InpatFeeAvg(request.HospitalId); var list = reportService.InpatFeeAvg(request.HospitalId);
...@@ -80,6 +135,7 @@ public ApiResponse InpatFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody] ...@@ -80,6 +135,7 @@ public ApiResponse InpatFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("medicine")] [Route("medicine")]
[HttpPost]
public ApiResponse Medicine([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request) public ApiResponse Medicine([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{ {
var list = reportService.Medicine(request.HospitalId, request.IsIndex); var list = reportService.Medicine(request.HospitalId, request.IsIndex);
...@@ -91,6 +147,7 @@ public ApiResponse Medicine([CustomizeValidator(RuleSet = "Query"), FromBody]Rep ...@@ -91,6 +147,7 @@ public ApiResponse Medicine([CustomizeValidator(RuleSet = "Query"), FromBody]Rep
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Route("income")] [Route("income")]
[HttpPost]
public ApiResponse Income([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request) public ApiResponse Income([CustomizeValidator(RuleSet = "Query"), FromBody]ReportRequest request)
{ {
var list = reportService.Income(request.HospitalId, request.IsIndex); var list = reportService.Income(request.HospitalId, request.IsIndex);
...@@ -123,5 +180,31 @@ public ApiResponse AvgRatio([CustomizeValidator(RuleSet = "Query"), FromBody]Rep ...@@ -123,5 +180,31 @@ public ApiResponse AvgRatio([CustomizeValidator(RuleSet = "Query"), FromBody]Rep
var list = reportService.AvgRatio(request.HospitalId); var list = reportService.AvgRatio(request.HospitalId);
return new ApiResponse(ResponseType.OK, "", list); 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 FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.DtoModels.Request; using Performance.DtoModels.Request;
...@@ -29,7 +30,7 @@ public SmsController(SmsService smsService) ...@@ -29,7 +30,7 @@ public SmsController(SmsService smsService)
/// <returns></returns> /// <returns></returns>
[Route("code")] [Route("code")]
[HttpPost] [HttpPost]
[NoVerify] [AllowAnonymous]
public ApiResponse Code([FromBody]SmsCodeRequest request) public ApiResponse Code([FromBody]SmsCodeRequest request)
{ {
if (!_smsService.SendCode(request.Type, request.Mobile)) if (!_smsService.SendCode(request.Type, request.Mobile))
...@@ -44,7 +45,7 @@ public ApiResponse Code([FromBody]SmsCodeRequest request) ...@@ -44,7 +45,7 @@ public ApiResponse Code([FromBody]SmsCodeRequest request)
/// <returns></returns> /// <returns></returns>
[Route("check")] [Route("check")]
[HttpPost] [HttpPost]
[NoVerify] [AllowAnonymous]
public ApiResponse Check([CustomizeValidator(RuleSet = "SmsCheck")][FromBody]SmsCodeRequest request) public ApiResponse Check([CustomizeValidator(RuleSet = "SmsCheck")][FromBody]SmsCodeRequest request)
{ {
if (!_smsService.Check(request.Mobile, request.Code)) 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -10,18 +13,26 @@ namespace Performance.Api.Controllers ...@@ -10,18 +13,26 @@ namespace Performance.Api.Controllers
[ApiController] [ApiController]
public class ValuesController : ControllerBase public class ValuesController : ControllerBase
{ {
private readonly IHubContext<AllotLogHub> hubContext;
public ValuesController(IHubContext<AllotLogHub> hubContext)
{
this.hubContext = hubContext;
}
// GET api/values // GET api/values
[HttpGet] [HttpGet]
[NoVerify] [AllowAnonymous]
public ActionResult<IEnumerable<string>> Get() public ActionResult<IEnumerable<string>> Get()
{ {
hubContext.Clients.Group("aaaa").SendAsync("ReceiveMessage", "绩效开始执行", "绩效开始执行");
//var excel = _excelService.Analyze(@"C:\Users\ry\Desktop\文件\测试.xlsx"); //var excel = _excelService.Analyze(@"C:\Users\ry\Desktop\文件\测试.xlsx");
return new string[] { "value1", "value2" }; return new string[] { "value1", "value2" };
} }
// GET api/values/5 // GET api/values/5
[HttpGet("{id}")] [HttpGet("{id}")]
[NoVerify] [AllowAnonymous]
public ActionResult<string> Getid(int id) public ActionResult<string> Getid(int id)
{ {
return "value"; return "value";
......
...@@ -33,37 +33,20 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron ...@@ -33,37 +33,20 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{ {
var request = context.HttpContext.Request; 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倒带功能 //启用body倒带功能
request.EnableRewind(); request.EnableRewind();
//记录Request请求
var kv = GetRequestContent(request);
_logger.LogInformation($"请求内容 {request.Method}:{JsonHelper.Serialize(kv)}");
LogHelper.Information($"请求地址:{context.HttpContext.Request.Path};请求参数:{JsonHelper.Serialize(kv)}", "请求内容"); //接口禁用
//接口禁用 if (context.Filters.Any(item => item is ApiDisableAttribute))
var disable = ((ControllerActionDescriptor)context.ActionDescriptor).MethodInfo.GetCustomAttributes(typeof(DisableAttribute), true);
if (disable.Length > 0)
{ {
var response = new ApiResponse(ResponseType.Disable, "接口已禁用"); var response = new ApiResponse(ResponseType.Disable, "接口已禁用");
context.Result = new ObjectResult(response); context.Result = new ObjectResult(response);
return; 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) if (!context.ModelState.IsValid)
{ {
...@@ -74,8 +57,8 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron ...@@ -74,8 +57,8 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
context.Result = new ObjectResult(response); context.Result = new ObjectResult(response);
var jsonData = JsonHelper.Serialize(context.Result); var jsonData = JsonHelper.Serialize(context.Result);
_logger.LogInformation($"响应结果:{jsonData}"); _logger.LogInformation($"响应结果:{jsonData}");
LogHelper.Information($"请求地址:{context.HttpContext.Request.Path};响应结果:{jsonData}", "响应结果");
} }
//记录response结果 //记录response结果
else else
{ {
...@@ -85,66 +68,15 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron ...@@ -85,66 +68,15 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
if (executedContext.Result is ObjectResult) if (executedContext.Result is ObjectResult)
{ {
LogHelper.Information(JsonHelper.Serialize(executedContext.Result), "响应结果"); _logger.LogInformation("响应结果" + JsonHelper.Serialize(executedContext.Result));
var objectResult = (ObjectResult)executedContext.Result; var objectResult = (ObjectResult)executedContext.Result;
var jsonData = JsonHelper.Serialize(objectResult.Value); var jsonData = JsonHelper.Serialize(objectResult.Value);
_logger.LogInformation($"响应结果:{jsonData}"); _logger.LogInformation($"请求地址:{context.HttpContext.Request.Path};响应结果:{jsonData}");
LogHelper.Information($"请求地址:{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)] [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) ...@@ -26,21 +26,21 @@ public Task OnExceptionAsync(ExceptionContext context)
_logger.LogWarning($"接口错误警告:{context.Exception.ToString()}"); _logger.LogWarning($"接口错误警告:{context.Exception.ToString()}");
var response = new ApiResponse(ResponseType.Fail, context.Exception.Message); var response = new ApiResponse(ResponseType.Fail, context.Exception.Message);
context.Result = new ObjectResult(response); context.Result = new ObjectResult(response);
LogHelper.Warning(JsonHelper.Serialize(response), "接口错误警告"); _logger.LogWarning("接口错误警告" + JsonHelper.Serialize(response));
} }
else if (context.Exception is PerformanceTokenErrorException) else if (context.Exception is PerformanceTokenErrorException)
{ {
_logger.LogWarning($"Token Error:{context.Exception.ToString()}"); _logger.LogWarning($"Token Error:{context.Exception.ToString()}");
var response = new ApiResponse(ResponseType.TokenError, context.Exception.Message); var response = new ApiResponse(ResponseType.TokenError, context.Exception.Message);
context.Result = new ObjectResult(response); context.Result = new ObjectResult(response);
LogHelper.Warning(JsonHelper.Serialize(response), "Token Error"); _logger.LogWarning("Token Error" + JsonHelper.Serialize(response));
} }
else else
{ {
_logger.LogError($"接口异常:{context.Exception.ToString()}"); _logger.LogError($"接口异常:{context.Exception.ToString()}");
var response = new ApiResponse(ResponseType.Error, "接口内部异常", context.Exception.Message); var response = new ApiResponse(ResponseType.Error, "接口内部异常", context.Exception.Message);
context.Result = new ObjectResult(response); context.Result = new ObjectResult(response);
LogHelper.Error(JsonHelper.Serialize(response), "接口内部异常"); _logger.LogError("接口内部异常" + JsonHelper.Serialize(response));
} }
return Task.CompletedTask; return Task.CompletedTask;
} }
......
...@@ -5,14 +5,36 @@ ...@@ -5,14 +5,36 @@
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath />
<DocumentationFile>..\Performance.Api\wwwroot\Performance.Api.xml</DocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="aaa\**" />
<Compile Remove="Files\**" /> <Compile Remove="Files\**" />
<Compile Remove="Hubs\**" />
<Content Remove="aaa\**" />
<Content Remove="Files\**" /> <Content Remove="Files\**" />
<Content Remove="Hubs\**" />
<EmbeddedResource Remove="aaa\**" />
<EmbeddedResource Remove="Files\**" /> <EmbeddedResource Remove="Files\**" />
<EmbeddedResource Remove="Hubs\**" />
<None Remove="aaa\**" />
<None Remove="Files\**" /> <None Remove="Files\**" />
<None Remove="Hubs\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="Template\~%24医院绩效模板.xlsx" />
</ItemGroup>
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="8.0.0" /> <PackageReference Include="AutoMapper" Version="8.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.0.0" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.0.0" />
<PackageReference Include="CSRedisCore" Version="3.0.45" /> <PackageReference Include="CSRedisCore" Version="3.0.45" />
...@@ -23,7 +45,7 @@ ...@@ -23,7 +45,7 @@
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" 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" Version="8.0.15" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.15" /> <PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.15" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
...@@ -31,6 +53,7 @@ ...@@ -31,6 +53,7 @@
<PackageReference Include="NLog.Extensions.Logging" Version="1.4.0" /> <PackageReference Include="NLog.Extensions.Logging" Version="1.4.0" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.8.0" /> <PackageReference Include="NLog.Web.AspNetCore" Version="4.8.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="Microsoft.AspNet.SignalR" Version="2.4.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
...@@ -45,6 +68,36 @@ ...@@ -45,6 +68,36 @@
<Content Update="nlog.config"> <Content Update="nlog.config">
<CopyToOutputDirectory>Never</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content> </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> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JSONSchema="" /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JSONSchema="" /></VisualStudio></ProjectExtensions>
......
...@@ -12,16 +12,20 @@ ...@@ -12,16 +12,20 @@
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "api/values", "launchUrl": "index.html",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" //"ASPNETCORE_ENVIRONMENT": "Development"
//"ASPNETCORE_ENVIRONMENT": "Production"
"ASPNETCORE_ENVIRONMENT": "Localhost"
} }
}, },
"Performance.Api": { "Performance.Api": {
"commandName": "Project", "commandName": "Project",
"launchUrl": "api/values", "launchUrl": "index.html",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" //"ASPNETCORE_ENVIRONMENT": "Development"
//"ASPNETCORE_ENVIRONMENT": "Production"
"ASPNETCORE_ENVIRONMENT": "Localhost"
}, },
"applicationUrl": "http://localhost:5001" "applicationUrl": "http://localhost:5001"
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Reflection; using System.Reflection;
...@@ -47,7 +48,7 @@ public Startup(IConfiguration configuration) ...@@ -47,7 +48,7 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) 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); Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
#region appsetting注入 #region appsetting注入
...@@ -56,16 +57,17 @@ public void ConfigureServices(IServiceCollection services) ...@@ -56,16 +57,17 @@ public void ConfigureServices(IServiceCollection services)
.Configure<Application>(Configuration.GetSection("Application")) .Configure<Application>(Configuration.GetSection("Application"))
.Configure<HuyiSmsConfig>(Configuration.GetSection("HuyiSmsConfig")) .Configure<HuyiSmsConfig>(Configuration.GetSection("HuyiSmsConfig"))
.Configure<EmailOptions>(Configuration.GetSection("EmailOptions")) .Configure<EmailOptions>(Configuration.GetSection("EmailOptions"))
.Configure<WebapiUrl>(Configuration.GetSection("WebapiUrl")); .Configure<WebapiUrl>(Configuration.GetSection("WebapiUrl"));
#endregion #endregion
var connection = services.BuildServiceProvider().GetService<IOptions<AppConnection>>(); var connection = services.BuildServiceProvider().GetService<IOptions<AppConnection>>();
#region json & fluentvalidation & filter #region json & fluentvalidation & filter
services services
//筛选器配置 //筛选器配置
.AddMvc(option => .AddMvc(option =>
{ {
option.Filters.Add<AuthenticationFilter>();
option.Filters.Add<ActionsFilter>(); option.Filters.Add<ActionsFilter>();
option.Filters.Add<ExceptionsFilter>(); option.Filters.Add<ExceptionsFilter>();
}) })
...@@ -108,12 +110,6 @@ public void ConfigureServices(IServiceCollection services) ...@@ -108,12 +110,6 @@ public void ConfigureServices(IServiceCollection services)
.AddPerformanceRepoitory(); .AddPerformanceRepoitory();
#endregion #endregion
#region swagger
//services.AddSwaggerGen(c =>
//{
// c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });
//});
#endregion
#region custom util #region custom util
...@@ -139,10 +135,12 @@ public void ConfigureServices(IServiceCollection services) ...@@ -139,10 +135,12 @@ public void ConfigureServices(IServiceCollection services)
#endregion #endregion
#region redis #region redis
var csredis = new CSRedis.CSRedisClient(connection.Value.RedisConnectionString); //var csredis = new CSRedis.CSRedisClient(connection.Value.RedisConnectionString);
RedisHelper.Initialization(csredis); //RedisHelper.Initialization(csredis);
#endregion #endregion
services.AddMemoryCache();
#region hangfire #region hangfire
services.AddHangfire(config => services.AddHangfire(config =>
{ {
...@@ -151,12 +149,57 @@ public void ConfigureServices(IServiceCollection services) ...@@ -151,12 +149,57 @@ public void ConfigureServices(IServiceCollection services)
}); });
#endregion #endregion
services.AddSignalR();
services.AddCors(options =>
{
options.AddPolicy("SignalrCore", policy =>
{
policy.SetIsOriginAllowed(origin => true).AllowAnyHeader().AllowAnyMethod().AllowCredentials();
});
});
#region //ef配置 #region //ef配置
services.AddDbContext<PerformanceDbContext>(options => services.AddDbContext<PerformanceDbContext>(options =>
{ {
options.UseMySQL(connection.Value.PerformanceConnectionString); options.UseMySQL(connection.Value.PerformanceConnectionString);
}); });
#endregion #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. // 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 ...@@ -171,16 +214,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
{ {
app.UseStatusCodePagesWithReExecute("/error/{0}"); 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.), #region Swagger
//// specifying the Swagger JSON endpoint. app.UseSwagger();
//app.UseSwaggerUI(c => app.UseSwaggerUI(c =>
//{ {
// c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); c.SwaggerEndpoint(Configuration["Application:SwaggerEndpoint"], "v1.0");
// c.RoutePrefix = string.Empty; //c.SwaggerEndpoint("/swagger/v1/swagger.json", "v1.0");
//}); c.RoutePrefix = "";
});
#endregion
#region hangfire #region hangfire
...@@ -188,6 +231,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF ...@@ -188,6 +231,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new[] { new HangfireAuthorizationFilter() } }); app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new[] { new HangfireAuthorizationFilter() } });
#endregion #endregion
app.UseCors("SignalrCore");
app.UseSignalR(routes => routes.MapHub<AllotLogHub>("/performance/allotLogHub"));
loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName); loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName);
app.UseMvc(); app.UseMvc();
} }
......
using Microsoft.Extensions.Caching.Memory; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Caching.Memory;
using Performance.DtoModels; using Performance.DtoModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Performance.Api namespace Performance.Api
{ {
public class ClaimService public class ClaimService
{ {
IMemoryCache _memoryCache; private readonly IHttpContextAccessor contextAccessor;
public ClaimService(IMemoryCache memoryCache) 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)) var @object = memoryCache.Get(token);
throw new PerformanceTokenErrorException("token is not null"); return @object == null;
var user = _memoryCache.Get<UserIdentity>(token);
if (user == null)
throw new PerformanceTokenErrorException("当前用户未登录");
return user;
} }
} }
} }
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 @@ ...@@ -13,7 +13,7 @@
}, },
"Application": { "Application": {
//登录过期时间 //登录过期时间
"ExpirationMinutes": "420", "ExpirationMinutes": "120",
//验证码过期 //验证码过期
"SmsCodeMinutes": "5", "SmsCodeMinutes": "5",
//护士长二次绩效管理员 //护士长二次绩效管理员
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
"WebapiUrl": { "WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import", "ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index", "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 @@ ...@@ -20,7 +20,8 @@
"EmailOptions": { "EmailOptions": {
"SmtpServer": "smtpdm.aliyun.com", "SmtpServer": "smtpdm.aliyun.com",
"Account": "service@email.suvalue.com", "Account": "service@email.suvalue.com",
"Password": "SuValue123456" "Password": "SuValue123456",
"IsEnable": true
}, },
"Application": { "Application": {
//登录过期时间 //登录过期时间
...@@ -36,11 +37,13 @@ ...@@ -36,11 +37,13 @@
//邮件指定接收人 //邮件指定接收人
"Receiver": [ "chengxiang.li@suvalue.com", "486035085@qq.com" ], "Receiver": [ "chengxiang.li@suvalue.com", "486035085@qq.com" ],
"AbsolutePath": "E:\\wwwroot\\testjx.suvalue.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": { "WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import", "ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index", "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) ...@@ -55,7 +55,7 @@ static void Main(string[] args)
var option = services.BuildServiceProvider().GetService<IOptions<EmailOptions>>(); 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 emailService = services.BuildServiceProvider().GetService<IEmailService>();
var message = new EmailMessage var message = new EmailMessage
{ {
......
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
"EmailOptions": { "EmailOptions": {
"SmtpServer": "smtpdm.aliyun.com", "SmtpServer": "smtpdm.aliyun.com",
"Account": "service@email.suvalue.com", "Account": "service@email.suvalue.com",
"Password": "SuValue123456" "Password": "SuValue123456",
"IsEnable": true
}, },
"Application": { "Application": {
//登录过期时间 //登录过期时间
......
...@@ -6,27 +6,27 @@ ...@@ -6,27 +6,27 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class ApiRequest //public class ApiRequest
{ //{
/// <summary> // /// <summary>
/// 登录后返回登录令牌 // /// 登录后返回登录令牌
/// </summary> // /// </summary>
public string Token { get; set; } // public string Token { get; set; }
/// <summary> // /// <summary>
/// 版本号 v1 // /// 版本号 v1
/// </summary> // /// </summary>
public string Version { get; set; } // public string Version { get; set; }
/// <summary> // /// <summary>
/// 设备号 1 苹果 2 安卓 3 网页 // /// 设备号 1 苹果 2 安卓 3 网页
/// </summary> // /// </summary>
public string Device { get; set; } // public string Device { get; set; }
/// <summary> // /// <summary>
/// App名称 // /// App名称
/// </summary> // /// </summary>
public string AppName { get; set; } // public string AppName { get; set; }
///// <summary> // ///// <summary>
///// 操作用户 // ///// 操作用户
///// </summary> // ///// </summary>
//public Nullable<int> ActiveUID { get; set; } // //public Nullable<int> ActiveUID { get; set; }
} //}
} }
...@@ -20,5 +20,10 @@ public class WebapiUrl ...@@ -20,5 +20,10 @@ public class WebapiUrl
/// 上传文件地址 /// 上传文件地址
/// </summary> /// </summary>
public string ImportFile { get; set; } public string ImportFile { get; set; }
/// <summary>
/// Post请求地址
/// </summary>
public string HttpPost { get; set; }
} }
} }
...@@ -17,12 +17,34 @@ public enum SmsCodeType ...@@ -17,12 +17,34 @@ public enum SmsCodeType
/// <summary> 用户状态 </summary> /// <summary> 用户状态 </summary>
public enum States public enum States
{ {
[Description("登录")] [Description("启用")]
Enabled = 1, Enabled = 1,
[Description("其他")] [Description("禁用")]
Disabled = 2, 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 public enum AllotStates
{ {
/// <summary> 用户状态 </summary> /// <summary> 用户状态 </summary>
...@@ -43,7 +65,7 @@ public enum AllotStates ...@@ -43,7 +65,7 @@ public enum AllotStates
/// <summary> 正在生成绩效 </summary> /// <summary> 正在生成绩效 </summary>
[Description("正在生成绩效")] [Description("正在生成绩效")]
InGenerate = 5, InGenerate = 5,
/// <summary> 绩效结果解析成功 </summary> /// <summary> 绩效结果通过审核,允许下发 </summary>
[Description("数据验证通过")] [Description("数据验证通过")]
GenerateSucceed = 6, GenerateSucceed = 6,
/// <summary> 绩效解析失败 </summary> /// <summary> 绩效解析失败 </summary>
...@@ -52,5 +74,11 @@ public enum AllotStates ...@@ -52,5 +74,11 @@ public enum AllotStates
/// <summary> 归档 </summary> /// <summary> 归档 </summary>
[Description("归档")] [Description("归档")]
Archive = 8, 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 ...@@ -47,6 +47,16 @@ public class ComputeEmployee
public string JobTitle { get; set; } public string JobTitle { get; set; }
/// <summary> /// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
/// <summary>
/// 基础绩效系数
/// </summary>
public Nullable<decimal> Basics { get; set; }
/// <summary>
/// 岗位系数 /// 岗位系数
/// </summary> /// </summary>
public Nullable<decimal> PostCoefficient { get; set; } public Nullable<decimal> PostCoefficient { get; set; }
...@@ -95,5 +105,25 @@ public class ComputeEmployee ...@@ -95,5 +105,25 @@ public class ComputeEmployee
///// 发放系数 ///// 发放系数
///// </summary> ///// </summary>
//public Nullable<decimal> Grant { get; set; } //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 ...@@ -96,6 +96,11 @@ public class ComputeResult
public Nullable<decimal> GiveFee { get; set; } public Nullable<decimal> GiveFee { get; set; }
/// <summary> /// <summary>
/// 参考基数专用绩效合计
/// </summary>
public Nullable<decimal> BaiscNormPerforTotal { get; set; }
/// <summary>
/// 参加工作时间(来自人员名单) /// 参加工作时间(来自人员名单)
/// </summary> /// </summary>
public Nullable<DateTime> WorkTime { get; set; } public Nullable<DateTime> WorkTime { get; set; }
...@@ -125,6 +130,15 @@ public class ComputeResult ...@@ -125,6 +130,15 @@ public class ComputeResult
/// </summary> /// </summary>
public decimal? Adjust { get; set; } public decimal? Adjust { get; set; }
public string UnitType { get; set; }
public string Remark { get; set; }
/// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
///// <summary> ///// <summary>
///// 工作量绩效 ///// 工作量绩效
///// </summary> ///// </summary>
......
using System; //using System;
using System.Collections.Generic; //using System.Collections.Generic;
using System.Text; //using System.Text;
namespace Performance.DtoModels //namespace Performance.DtoModels
{ //{
public class ComputeSource // public class ComputeSource
{ // {
/// <summary> // /// <summary>
/// 核算单元 // /// 核算单元
/// </summary> // /// </summary>
public string AccountingUnit { get; set; } // public string AccountingUnit { get; set; }
/// <summary> // /// <summary>
/// 核算单元医生数量 // /// 核算单元医生数量
/// </summary> // /// </summary>
public Nullable<decimal> Number { get; set; } // public Nullable<decimal> Number { get; set; }
/// <summary> // /// <summary>
/// 医生基础系数 // /// 医生基础系数
/// </summary> // /// </summary>
public Nullable<decimal> BasicFactor { get; set; } // public Nullable<decimal> BasicFactor { get; set; }
/// <summary> // /// <summary>
/// 倾斜系数 // /// 倾斜系数
/// </summary> // /// </summary>
public Nullable<decimal> SlopeFactor { get; set; } // public Nullable<decimal> SlopeFactor { get; set; }
/// <summary> // /// <summary>
/// 其他绩效1 // /// 其他绩效1
/// </summary> // /// </summary>
public Nullable<decimal> OtherPerfor1 { get; set; } // public Nullable<decimal> OtherPerfor1 { get; set; }
/// <summary> // /// <summary>
/// 其他绩效2 // /// 其他绩效2
/// </summary> // /// </summary>
public Nullable<decimal> OtherPerfor2 { get; set; } // public Nullable<decimal> OtherPerfor2 { get; set; }
/// <summary> // /// <summary>
/// 医院奖罚 // /// 医院奖罚
/// </summary> // /// </summary>
public Nullable<decimal> Extra { get; set; } // public Nullable<decimal> Extra { get; set; }
/// <summary> // /// <summary>
/// 考核对分率 // /// 考核对分率
/// </summary> // /// </summary>
public Nullable<decimal> ScoringAverage { get; set; } // public Nullable<decimal> ScoringAverage { get; set; }
/// <summary> // /// <summary>
/// 调节系数 // /// 调节系数
/// </summary> // /// </summary>
public Nullable<decimal> AdjustFactor { get; set; } // public Nullable<decimal> AdjustFactor { get; set; }
/// <summary> // /// <summary>
/// 科室业绩 // /// 科室业绩
/// </summary> // /// </summary>
public Nullable<decimal> Income { get; set; } // public Nullable<decimal> Income { get; set; }
/// <summary> // /// <summary>
/// 业绩绩效 // /// 业绩绩效
/// </summary> // /// </summary>
public Nullable<decimal> PerforFee { get; set; } // public Nullable<decimal> PerforFee { get; set; }
/// <summary> // /// <summary>
/// 工作量绩效 // /// 工作量绩效
/// </summary> // /// </summary>
public Nullable<decimal> WorkloadFee { get; set; } // public Nullable<decimal> WorkloadFee { get; set; }
/// <summary> // /// <summary>
/// 绩效合计 // /// 绩效合计
/// </summary> // /// </summary>
public Nullable<decimal> PerforTotal { get; set; } // public Nullable<decimal> PerforTotal { get; set; }
/// <summary> // /// <summary>
/// 人均绩效 // /// 人均绩效
/// </summary> // /// </summary>
public Nullable<decimal> Avg { get; set; } // public Nullable<decimal> Avg { get; set; }
/// <summary> // /// <summary>
/// 实发绩效 // /// 实发绩效
/// </summary> // /// </summary>
public Nullable<decimal> GiveFee { get; set; } // public Nullable<decimal> GiveFee { get; set; }
} // }
} //}
...@@ -11,6 +11,24 @@ public enum ExcelVersion ...@@ -11,6 +11,24 @@ public enum ExcelVersion
xls xls
} }
/// <summary> 核算单元类型 </summary>
public enum UnitType
{
[Description("医生组")]
医生组 = 1,
[Description("护理组")]
护理组 = 2,
[Description("医技组")]
医技组 = 3,
[Description("专家组")]
专家组 = 4,
[Description("其他组")]
其他组 = 5,
[Description("特殊核算组")]
特殊核算组 = 6,
}
public enum SheetType public enum SheetType
{ {
/// <summary> 无法识别 </summary> /// <summary> 无法识别 </summary>
...@@ -56,59 +74,15 @@ public enum SheetType ...@@ -56,59 +74,15 @@ public enum SheetType
/// <summary> 临床科室护士绩效测算表 </summary> /// <summary> 临床科室护士绩效测算表 </summary>
[Description("临床科室护士绩效测算表")] [Description("临床科室护士绩效测算表")]
ComputeNurseAccount = 14, ComputeNurseAccount = 14,
}
/// <summary> /// <summary> 临床人员名单 </summary>
/// 绩效类型 [Description("临床人员名单")]
/// </summary> ClinicEmployee = 15,
//public enum PerformanceType
//{
// /// <summary> </summary>
// [Description("")]
// Null = 0,
// /// <summary> 绩效基数临床科室主任(专门用来计算科主任绩效,由此产生=>>临床科室主任人均绩效)</summary> /// <summary> 特殊临床科室医护绩效测算基础 </summary>
// [Description("绩效基数临床科室主任")] [Description("特殊临床科室医护绩效测算基础")]
// StandardDirector = 1, AccountBasicSpecial = 16,
// /// <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>
/// 核算单元类型 /// 核算单元类型
...@@ -119,11 +93,11 @@ public enum AccountUnitType ...@@ -119,11 +93,11 @@ public enum AccountUnitType
[Description("")] [Description("")]
Null = 1, Null = 1,
/// <summary> 临床科室 </summary> /// <summary> 临床科室 </summary>
[Description("临床科室")] [Description("科主任")]
临床科室 = 2, 科主任 = 2,
/// <summary> 临床科室 </summary> /// <summary> 临床科室 </summary>
[Description("医技科室")] [Description("护士长")]
医技科室 = 3, 护士长 = 3,
/// <summary> 行政高层 </summary> /// <summary> 行政高层 </summary>
[Description("行政高层")] [Description("行政高层")]
行政高层 = 4, 行政高层 = 4,
...@@ -151,6 +125,8 @@ public enum PerforType ...@@ -151,6 +125,8 @@ public enum PerforType
护士, 护士,
[Description("临床主任护士长平均")] [Description("临床主任护士长平均")]
临床主任护士长平均, 临床主任护士长平均,
[Description("临床主任医技主任护士长平均")]
临床主任医技主任护士长平均,
[Description("临床医生人均绩效")] [Description("临床医生人均绩效")]
临床医生, 临床医生,
[Description("医技医生人均绩效")] [Description("医技医生人均绩效")]
...@@ -166,15 +142,32 @@ public enum PerforType ...@@ -166,15 +142,32 @@ public enum PerforType
} }
/// <summary> /// <summary>
/// 当前枚举为效率绩效、规模绩效中系数中文名称 /// 保底绩效
/// 对应表cof_director中JobTitle 全文字匹配
/// </summary> /// </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;
using System.Collections.Generic; //using System.Collections.Generic;
using System.Text; //using System.Text;
namespace Performance.DtoModels //namespace Performance.DtoModels
{ //{
public class PerDataAccount : IPerData // public class PerDataAccount : IPerData
{ // {
/// <summary> // public int UnitType;
/// 核算单元
/// </summary> // /// <summary>
public string AccountingUnit { 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 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; }
/// 其他绩效1
/// </summary> // /// <summary>
public Nullable<decimal> OtherPerfor1 { get; set; } // /// 其他绩效1
// /// </summary>
/// <summary> // public Nullable<decimal> OtherPerfor1 { get; set; }
/// 其他绩效2
/// </summary> // /// <summary>
public Nullable<decimal> OtherPerfor2 { get; set; } // /// 其他绩效2
// /// </summary>
/// <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> RealGiveFee { get; set; } // /// 实发绩效
} // /// </summary>
} // public Nullable<decimal> RealGiveFee { get; set; }
// }
//}
...@@ -7,14 +7,26 @@ namespace Performance.DtoModels ...@@ -7,14 +7,26 @@ namespace Performance.DtoModels
public class PerDataAccountBaisc : IPerData public class PerDataAccountBaisc : IPerData
{ {
/// <summary> /// <summary>
/// 核算单元(医生组) /// 行号
/// </summary>
public int RowNumber { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
#region EXCEL读取
/// <summary>
/// 核算单元类别 1 医生组 2护理组 3医技组
/// </summary> /// </summary>
public string DoctorAccountingUnit { get; set; } public string UnitType { get; set; }
/// <summary> /// <summary>
/// 核算单元(护理组) /// 核算单元
/// </summary> /// </summary>
public string NurseAccountingUnit { get; set; } public string AccountingUnit { get; set; }
/// <summary> /// <summary>
/// 科室名称 /// 科室名称
...@@ -22,125 +34,123 @@ public class PerDataAccountBaisc : IPerData ...@@ -22,125 +34,123 @@ public class PerDataAccountBaisc : IPerData
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 科主任数量 /// 定科人数
/// </summary> /// </summary>
public decimal DoctorDirectorNumber { get; set; } public decimal PermanentStaff { get; set; }
/// <summary>
/// 科主任/护士长数量
/// </summary>
public decimal ManagerNumber { get; set; }
/// <summary> /// <summary>
/// 核算单元医生数量 /// 核算单元医生数量
/// </summary> /// </summary>
public decimal DoctorNumber { get; set; } public decimal Number { get; set; }
/// <summary> /// <summary>
/// 医生基础系数 /// 医生基础系数
/// </summary> /// </summary>
public decimal DoctorBasicFactor { get; set; } public decimal BasicFactor { get; set; }
/// <summary> /// <summary>
/// 倾斜系数 /// 倾斜系数
/// </summary> /// </summary>
public decimal DoctorSlopeFactor { get; set; } public decimal SlopeFactor { get; set; }
/// <summary> /// <summary>
/// 其他绩效1 /// 其他绩效1
/// </summary> /// </summary>
public decimal DoctorOtherPerfor1 { get; set; } public decimal OtherPerfor1 { get; set; }
/// <summary> /// <summary>
/// 其他绩效2 /// 其他绩效2
/// </summary> /// </summary>
public decimal DoctorOtherPerfor2 { get; set; } public decimal OtherPerfor2 { get; set; }
/// <summary> /// <summary>
/// 医院奖罚 /// 医院奖罚
/// </summary> /// </summary>
public decimal DoctorExtra { get; set; } public decimal Extra { get; set; }
/// <summary> /// <summary>
/// 考核对分率 /// 考核对分率
/// </summary> /// </summary>
public decimal DoctorScoringAverage { get; set; } public decimal ScoringAverage { get; set; }
/// <summary> /// <summary>
/// 调节系数 /// 调节系数
/// </summary> /// </summary>
public decimal DoctorAdjustFactor { get; set; } public decimal AdjustFactor { get; set; }
/// <summary> /// <summary>
/// 护士长人 /// 规模绩效系
/// </summary> /// </summary>
public decimal NurseHeadNumber { get; set; } public decimal Scale { get; set; }
/// <summary> /// <summary>
/// 核算单元护士数量 /// 效率绩效系数
/// </summary> /// </summary>
public decimal NurseNumber { get; set; } public decimal Effic { get; set; }
/// <summary> /// <summary>
/// 护理基础系数 /// 发放系数
/// </summary> /// </summary>
public decimal NurseBasicFactor { get; set; } public decimal Grant { get; set; }
/// <summary> /// <summary>
/// 护理倾斜系数 /// 保底绩效参考标准
/// </summary> /// </summary>
public decimal NurseSlopeFactor { get; set; } public string MinimumReference { get; set; }
/// <summary> /// <summary>
/// 其他绩效1 /// 保底绩效系数
/// </summary> /// </summary>
public decimal NurseOtherPerfor1 { get; set; } public Nullable<decimal> MinimumFactor { get; set; }
/// <summary> /// <summary>
/// 其他绩效2 /// 工作量倾斜系数
/// </summary> /// </summary>
public decimal NurseOtherPerfor2 { get; set; } public Nullable<decimal> WorkSlopeFactor { get; set; }
#endregion
/// <summary>
/// 医院奖罚
/// </summary>
public decimal NurseExtra { get; set; }
#region 由计算得出
/// <summary> /// <summary>
/// 考核对分率 /// 保底绩效金额
/// </summary>
public decimal NurseScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public decimal NurseAdjustFactor { get; set; }
/// <summary>
/// 行号
/// </summary> /// </summary>
public int RowNumber { get; set; } public Nullable<decimal> MinimumFee { get; set; }
/// <summary> /// <summary>
/// 规模绩效系数 /// 科室业绩
/// </summary> /// </summary>
public Nullable<decimal> DoctorScale { get; set; } public Nullable<decimal> Income { get; set; }
/// <summary> /// <summary>
/// 效率绩效系数 /// 业绩绩效
/// </summary> /// </summary>
public Nullable<decimal> DoctorEffic { get; set; } public Nullable<decimal> PerforFee { get; set; }
/// <summary> /// <summary>
/// 发放系数 /// 工作量绩效
/// </summary> /// </summary>
public Nullable<decimal> DoctorGrant { get; set; } public Nullable<decimal> WorkloadFee { get; set; }
/// <summary> /// <summary>
/// 规模绩效系数 /// 绩效合计
/// </summary> /// </summary>
public Nullable<decimal> NurseScale { get; set; } public Nullable<decimal> PerforTotal { get; set; }
/// <summary> /// <summary>
/// 效率绩效系数 /// 人均绩效
/// </summary> /// </summary>
public Nullable<decimal> NurseEffic { get; set; } public Nullable<decimal> Avg { get; set; }
/// <summary> /// <summary>
/// 发放系数 /// 实发绩效
/// </summary> /// </summary>
public Nullable<decimal> NurseGrant { get; set; } public Nullable<decimal> RealGiveFee { get; set; }
#endregion
} }
} }
using System; //using System;
using System.Collections.Generic; //using System.Collections.Generic;
using System.Text; //using System.Text;
namespace Performance.DtoModels //namespace Performance.DtoModels
{ //{
public class PerDataAccountDoctor : IPerData // public class PerDataAccountDoctor : IPerData
{ // {
/// <summary> // public int UnitType { get; set; }
/// 核算单元 // /// <summary>
/// </summary> // /// 核算单元
public string AccountingUnit { get; set; } // /// </summary>
// public string AccountingUnit { get; set; }
/// <summary> // /// <summary>
/// 科室名称 // /// 科室名称
/// </summary> // /// </summary>
public string Department { get; set; } // public string Department { get; set; }
/// <summary> // /// <summary>
/// 核算单元医生数量 // /// 核算单元医生数量
/// </summary> // /// </summary>
public decimal Number { get; set; } // public decimal Number { get; set; }
/// <summary> // /// <summary>
/// 医生基础系数 // /// 医生基础系数
/// </summary> // /// </summary>
public decimal BasicFactor { get; set; } // public decimal BasicFactor { get; set; }
/// <summary> // /// <summary>
/// 倾斜系数 // /// 倾斜系数
/// </summary> // /// </summary>
public decimal SlopeFactor { get; set; } // public decimal SlopeFactor { get; set; }
/// <summary> // /// <summary>
/// 其他绩效1 // /// 其他绩效1
/// </summary> // /// </summary>
public decimal OtherPerfor1 { get; set; } // public decimal OtherPerfor1 { get; set; }
/// <summary> // /// <summary>
/// 其他绩效2 // /// 其他绩效2
/// </summary> // /// </summary>
public decimal OtherPerfor2 { get; set; } // public decimal OtherPerfor2 { get; set; }
/// <summary> // /// <summary>
/// 医院奖罚 // /// 医院奖罚
/// </summary> // /// </summary>
public decimal Extra { get; set; } // public decimal Extra { get; set; }
/// <summary> // /// <summary>
/// 考核对分率 // /// 考核对分率
/// </summary> // /// </summary>
public decimal ScoringAverage { get; set; } // public decimal ScoringAverage { get; set; }
/// <summary> // /// <summary>
/// 调节系数 // /// 调节系数
/// </summary> // /// </summary>
public decimal AdjustFactor { get; set; } // public decimal AdjustFactor { get; set; }
/// <summary> // /// <summary>
/// 科室业绩 // /// 科室业绩
/// </summary> // /// </summary>
public decimal Income { get; set; } // public decimal Income { get; set; }
/// <summary> // /// <summary>
/// 工作量绩效 // /// 工作量绩效
/// </summary> // /// </summary>
public decimal WorkloadFee { get; set; } // public decimal WorkloadFee { get; set; }
/// <summary> // /// <summary>
/// 绩效合计 // /// 绩效合计
/// </summary> // /// </summary>
public decimal PerforTotal { get; set; } // public decimal PerforTotal { get; set; }
/// <summary> // /// <summary>
/// 业绩绩效 // /// 业绩绩效
/// </summary> // /// </summary>
public decimal PerforFee { get; set; } // public decimal PerforFee { get; set; }
/// <summary> // /// <summary>
/// 实发绩效 // /// 实发绩效
/// </summary> // /// </summary>
public decimal RealGiveFee { get; set; } // public decimal RealGiveFee { get; set; }
/// <summary> // /// <summary>
/// 人均绩效 // /// 人均绩效
/// </summary> // /// </summary>
public decimal Avg { get; set; } // public decimal Avg { get; set; }
} // }
} //}
using System; //using System;
using System.Collections.Generic; //using System.Collections.Generic;
using System.Text; //using System.Text;
namespace Performance.DtoModels //namespace Performance.DtoModels
{ //{
public class PerDataAccountNurse : IPerData // public class PerDataAccountNurse : IPerData
{ // {
/// <summary> // public int UnitType { get; set; }
/// 核算单元 // /// <summary>
/// </summary> // /// 核算单元
public string AccountingUnit { get; set; } // /// </summary>
// public string AccountingUnit { get; set; }
/// <summary> // /// <summary>
/// 科室名称 // /// 科室名称
/// </summary> // /// </summary>
public string Department { get; set; } // public string Department { get; set; }
/// <summary> // /// <summary>
/// 核算单元护士数量 // /// 核算单元护士数量
/// </summary> // /// </summary>
public decimal Number { get; set; } // public decimal Number { get; set; }
/// <summary> // /// <summary>
/// 护理基础系数 // /// 护理基础系数
/// </summary> // /// </summary>
public decimal BasicFactor { get; set; } // public decimal BasicFactor { get; set; }
/// <summary> // /// <summary>
/// 护理倾斜系数 // /// 护理倾斜系数
/// </summary> // /// </summary>
public decimal SlopeFactor { get; set; } // public decimal SlopeFactor { get; set; }
/// <summary> // /// <summary>
/// 其他绩效1 // /// 其他绩效1
/// </summary> // /// </summary>
public decimal OtherPerfor1 { get; set; } // public decimal OtherPerfor1 { get; set; }
/// <summary> // /// <summary>
/// 其他绩效2 // /// 其他绩效2
/// </summary> // /// </summary>
public decimal OtherPerfor2 { get; set; } // public decimal OtherPerfor2 { get; set; }
/// <summary> // /// <summary>
/// 医院奖罚 // /// 医院奖罚
/// </summary> // /// </summary>
public decimal Extra { get; set; } // public decimal Extra { get; set; }
/// <summary> // /// <summary>
/// 考核对分率 // /// 考核对分率
/// </summary> // /// </summary>
public decimal ScoringAverage { get; set; } // public decimal ScoringAverage { get; set; }
/// <summary> // /// <summary>
/// 调节系数 // /// 调节系数
/// </summary> // /// </summary>
public decimal AdjustFactor { get; set; } // public decimal AdjustFactor { get; set; }
/// <summary> // /// <summary>
/// 科室业绩 // /// 科室业绩
/// </summary> // /// </summary>
public decimal Income { get; set; } // public decimal Income { get; set; }
/// <summary> // /// <summary>
/// 工作量绩效 // /// 工作量绩效
/// </summary> // /// </summary>
public decimal WorkloadFee { get; set; } // public decimal WorkloadFee { get; set; }
/// <summary> // /// <summary>
/// 绩效合计 // /// 绩效合计
/// </summary> // /// </summary>
public decimal PerforTotal { get; set; } // public decimal PerforTotal { get; set; }
/// <summary> // /// <summary>
/// 业绩绩效 // /// 业绩绩效
/// </summary> // /// </summary>
public decimal PerforFee { get; set; } // public decimal PerforFee { get; set; }
/// <summary> // /// <summary>
/// 实发绩效 // /// 实发绩效
/// </summary> // /// </summary>
public decimal RealGiveFee { get; set; } // public decimal RealGiveFee { get; set; }
/// <summary> // /// <summary>
/// 人均绩效 // /// 人均绩效
/// </summary> // /// </summary>
public decimal Avg { get; set; } // 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 ...@@ -32,6 +32,11 @@ public class PerDataEmployee : IPerData
public string AccountType { get; set; } public string AccountType { get; set; }
/// <summary> /// <summary>
/// 人员工号
/// </summary>
public string PersonnelNumber { get; set; }
/// <summary>
/// 医生姓名 /// 医生姓名
/// </summary> /// </summary>
public string DoctorName { get; set; } public string DoctorName { get; set; }
......
...@@ -56,5 +56,20 @@ public class PerDataSpecialUnit : IPerData ...@@ -56,5 +56,20 @@ public class PerDataSpecialUnit : IPerData
/// </summary> /// </summary>
public Nullable<decimal> Adjust { get; set; } public Nullable<decimal> Adjust { get; set; }
public int RowNumber { 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 @@ ...@@ -4,6 +4,11 @@
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>..\Performance.Api\wwwroot\Performance.DtoModels.xml</DocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="PerExcel\PerComputeData.cs" /> <Compile Remove="PerExcel\PerComputeData.cs" />
</ItemGroup> </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 ...@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary> /// <summary>
/// 二次分配请求 /// 二次分配请求
/// </summary> /// </summary>
public class AgainAllotRequest : ApiRequest public class AgainAllotRequest
{ {
/// <summary> /// <summary>
/// 二次分配ID /// 二次分配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 @@ ...@@ -5,7 +5,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class AllotRequest : ApiRequest public class AllotRequest
{ {
public int ID { get; set; } public int ID { get; set; }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class AssessColumnRequest : ApiRequest public class AssessColumnRequest
{ {
public int ColumnID { get; set; } public int ColumnID { get; set; }
public int AssessID { get; set; } public int AssessID { get; set; }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class AssessDataRequest : ApiRequest public class AssessDataRequest
{ {
public int AssessID { get; set; } public int AssessID { get; set; }
public List<AssessRow> AssessRow { get; set; } public List<AssessRow> AssessRow { get; set; }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class AssessRequest : ApiRequest public class AssessRequest
{ {
public int AssessID { get; set; } public int AssessID { get; set; }
public int AllotID { get; set; } public int AllotID { get; set; }
......
using System; using FluentValidation;
using FluentValidation; using System;
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class CofAgainRequest: ApiRequest public class CofAgainRequest
{ {
public int ID { get; set; } public int ID { get; set; }
...@@ -13,6 +13,11 @@ public class CofAgainRequest: ApiRequest ...@@ -13,6 +13,11 @@ public class CofAgainRequest: ApiRequest
public int AllotID { get; set; } public int AllotID { get; set; }
/// <summary> /// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 1 职称绩效 2 工作量绩效 3 满勤天数 /// 1 职称绩效 2 工作量绩效 3 满勤天数
/// </summary> /// </summary>
public int Type { get; set; } public int Type { get; set; }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class ComputerRequest : ApiRequest public class ComputerRequest
{ {
/// <summary> /// <summary>
/// 绩效数据id /// 绩效数据id
......
...@@ -8,7 +8,7 @@ namespace Performance.DtoModels ...@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary> /// <summary>
/// 查看科室绩效详情 /// 查看科室绩效详情
/// </summary> /// </summary>
public class DeptDetailRequest : ApiRequest public class DeptDetailRequest
{ {
/// <summary> /// <summary>
/// 绩效id /// 绩效id
...@@ -16,6 +16,11 @@ public class DeptDetailRequest : ApiRequest ...@@ -16,6 +16,11 @@ public class DeptDetailRequest : ApiRequest
public int AllotId { get; set; } public int AllotId { get; set; }
/// <summary> /// <summary>
/// 二次绩效id
/// </summary>
public int SecondId { get; set; }
/// <summary>
/// 绩效类型(1 医生组、 2 护理组) /// 绩效类型(1 医生组、 2 护理组)
/// </summary> /// </summary>
public int Type { get; set; } public int Type { get; set; }
...@@ -29,9 +34,9 @@ public class DetailRequestValidator : AbstractValidator<DeptDetailRequest> ...@@ -29,9 +34,9 @@ public class DetailRequestValidator : AbstractValidator<DeptDetailRequest>
{ {
public DetailRequestValidator() public DetailRequestValidator()
{ {
RuleFor(x => x.AllotId).NotNull().GreaterThan(0); //RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleFor(x => x.Type).NotNull().InclusiveBetween(1, 2); //RuleFor(x => x.Type).NotNull().InclusiveBetween(1, 5);
RuleFor(x => x.AccountID).NotNull().GreaterThan(0); //RuleFor(x => x.AccountID).NotNull().GreaterThan(0);
} }
} }
} }
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class DirectorRequest : ApiRequest public class DirectorRequest
{ {
public int ID { get; set; } public int ID { get; set; }
public int AllotID { get; set; } public int AllotID { get; set; }
/// <summary> /// <summary>
/// 科室 /// 科室
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class DownRequest
{
public int TempType { get; set; }
}
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class DrugpropRequest : ApiRequest public class DrugpropRequest
{ {
public int ID { get; set; } public int ID { get; set; }
...@@ -26,6 +26,10 @@ public class DrugpropRequest : ApiRequest ...@@ -26,6 +26,10 @@ public class DrugpropRequest : ApiRequest
/// 费用名称 /// 费用名称
/// </summary> /// </summary>
public string Charge { get; set; } public string Charge { get; set; }
/// <summary>
/// 费用类别
/// </summary>
public string ChargeType { get; set; }
public class DrugpropRequestValidator : AbstractValidator<DrugpropRequest> public class DrugpropRequestValidator : AbstractValidator<DrugpropRequest>
......
...@@ -115,7 +115,7 @@ public EmployeeRequestValidator() ...@@ -115,7 +115,7 @@ public EmployeeRequestValidator()
}; };
RuleSet("Select", () => RuleSet("Select", () =>
{ {
RuleFor(x => x.AllotID).NotNull().GreaterThan(0); //RuleFor(x => x.AllotID).NotNull().GreaterThan(0);
}); });
RuleSet("Insert", () => 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 ...@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary> /// <summary>
/// 登录请求 /// 登录请求
/// </summary> /// </summary>
public class HospitalRequest : ApiRequest public class HospitalRequest
{ {
public int ID { get; set; } public int ID { get; set; }
/// <summary> /// <summary>
...@@ -38,19 +38,19 @@ public class HospitalRequest : ApiRequest ...@@ -38,19 +38,19 @@ public class HospitalRequest : ApiRequest
/// <summary> /// <summary>
/// 是否开启年资系数 1 启用 2 禁用 /// 是否开启年资系数 1 启用 2 禁用
/// </summary> /// </summary>
public Nullable<int> IsOpenWorkYear { get; set; } //public Nullable<int> IsOpenWorkYear { get; set; }
/// <summary> /// <summary>
/// 是否开启药占比系数 1 启用 2 禁用 /// 是否开启药占比系数 1 启用 2 禁用
/// </summary> /// </summary>
public Nullable<int> IsOpenDrugprop { get; set; } public Nullable<int> IsOpenDrugprop { get; set; }
/// <summary> ///// <summary>
/// 是否开启ICU有效收入系数 1 启用 2 禁用 ///// 是否开启ICU有效收入系数 1 启用 2 禁用
/// </summary> ///// </summary>
public Nullable<int> IsOpenIncome { get; set; } //public Nullable<int> IsOpenIncome { get; set; }
/// <summary> ///// <summary>
/// 是否开启规模/效率绩效 1 启用 2 禁用 ///// 是否开启规模/效率绩效 1 启用 2 禁用
/// </summary> ///// </summary>
public Nullable<int> IsOpenDirector { get; set; } //public Nullable<int> IsOpenDirector { get; set; }
} }
public class HospitalRequestValidator : AbstractValidator<HospitalRequest> public class HospitalRequestValidator : AbstractValidator<HospitalRequest>
...@@ -60,10 +60,10 @@ public HospitalRequestValidator() ...@@ -60,10 +60,10 @@ public HospitalRequestValidator()
Action action = () => Action action = () =>
{ {
RuleFor(x => x.HosName).NotNull().NotEmpty().Length(1, 50); 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.HosLevel).NotNull().NotEmpty().Length(1, 50);
RuleFor(x => x.HosType).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", () => RuleSet("Insert", () =>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class IncomeRequest : ApiRequest public class IncomeRequest
{ {
public int ID { get; set; } public int ID { get; set; }
......
...@@ -8,7 +8,7 @@ namespace Performance.DtoModels ...@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary> /// <summary>
/// 登录请求 /// 登录请求
/// </summary> /// </summary>
public class LoginRequest : ApiRequest public class LoginRequest
{ {
/// <summary> /// <summary>
/// 登录类型 1 手机号登录 2 账号登录 /// 登录类型 1 手机号登录 2 账号登录
...@@ -16,6 +16,8 @@ public class LoginRequest : ApiRequest ...@@ -16,6 +16,8 @@ public class LoginRequest : ApiRequest
public int LoginType { get; set; } public int LoginType { get; set; }
public string Account { get; set; } public string Account { get; set; }
public string Password { get; set; } public string Password { get; set; }
public string AppName { get; set; }
public string Device { get; set; }
} }
public class LoginRequestValidator : AbstractValidator<LoginRequest> 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 @@ ...@@ -6,7 +6,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class PasswordRequest : ApiRequest public class PasswordRequest
{ {
/// <summary> /// <summary>
/// 原始密码 /// 原始密码
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class PositionRequest : ApiRequest public class PositionRequest
{ {
public int ID { get; set; } public int ID { get; set; }
......
...@@ -5,11 +5,24 @@ ...@@ -5,11 +5,24 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class ReportRequest : ApiRequest public class ReportRequest
{ {
public int HospitalId { get; set; } public int HospitalId { get; set; }
/// <summary> 是否为首页 </summary>
public int IsIndex { get; set; } 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> public class ReportRequestValidator : AbstractValidator<ReportRequest>
{ {
...@@ -19,6 +32,19 @@ public ReportRequestValidator() ...@@ -19,6 +32,19 @@ public ReportRequestValidator()
{ {
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0); 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 ...@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary> /// <summary>
/// 登录请求 /// 登录请求
/// </summary> /// </summary>
public class SetDepartmentRequest : ApiRequest public class SetDepartmentRequest
{ {
public int HospitalID { get; set; } public int HospitalID { get; set; }
} }
......
...@@ -8,7 +8,7 @@ namespace Performance.DtoModels ...@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary> /// <summary>
/// sheet数据详情请求 /// sheet数据详情请求
/// </summary> /// </summary>
public class SheetExportRequest : ApiRequest public class SheetExportRequest
{ {
public int SheetID { get; set; } public int SheetID { get; set; }
......
...@@ -8,7 +8,7 @@ namespace Performance.DtoModels ...@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary> /// <summary>
/// sheet页列表请求 /// sheet页列表请求
/// </summary> /// </summary>
public class SheetRequest : ApiRequest public class SheetRequest
{ {
public int AllotID { get; set; } public int AllotID { get; set; }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace Performance.DtoModels.Request namespace Performance.DtoModels.Request
{ {
public class SmsCodeRequest : ApiRequest public class SmsCodeRequest
{ {
/// <summary> /// <summary>
/// 短信验证类型 1 手机号登录 2 其他 /// 短信验证类型 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 @@ ...@@ -6,7 +6,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class UserRequest : ApiRequest public class UserRequest
{ {
public int ID { get; set; } public int ID { get; set; }
/// <summary> /// <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 @@ ...@@ -6,7 +6,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class WorkyearRequest : ApiRequest public class WorkyearRequest
{ {
public int ID { get; set; } public int ID { get; set; }
......
...@@ -57,5 +57,9 @@ public class AllotResponse ...@@ -57,5 +57,9 @@ public class AllotResponse
/// 是否可以下载 /// 是否可以下载
/// </summary> /// </summary>
public bool IsDown { get; set; } public bool IsDown { get; set; }
/// <summary>
/// 3 提取数据
/// </summary>
public int HasConfig { get; set; }
} }
} }
...@@ -20,7 +20,12 @@ public class ComputeResponse ...@@ -20,7 +20,12 @@ public class ComputeResponse
/// 人员名称 /// 人员名称
/// </summary> /// </summary>
public string EmployeeName { get; set; } public string EmployeeName { get; set; }
/// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
/// <summary> /// <summary>
/// 职位 /// 职位
/// </summary> /// </summary>
......
...@@ -6,7 +6,7 @@ namespace Performance.DtoModels ...@@ -6,7 +6,7 @@ namespace Performance.DtoModels
{ {
public class DeptDetailResponse public class DeptDetailResponse
{ {
public PerDataAccount Pandect { get; set; } public PerDataAccountBaisc Pandect { get; set; }
public List<DeptDetail> Economic { get; set; } public List<DeptDetail> Economic { get; set; }
public List<DeptDetail> Workload { get; set; } public List<DeptDetail> Workload { get; set; }
} }
...@@ -16,4 +16,44 @@ public class DeptDetail ...@@ -16,4 +16,44 @@ public class DeptDetail
public string ItemName { get; set; } public string ItemName { get; set; }
public decimal ItemValue { 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 @@ ...@@ -4,7 +4,7 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class DoctorResponse public class DeptResponse
{ {
/// <summary> /// <summary>
/// ///
...@@ -21,6 +21,8 @@ public class DoctorResponse ...@@ -21,6 +21,8 @@ public class DoctorResponse
/// </summary> /// </summary>
public Nullable<int> SheetID { get; set; } public Nullable<int> SheetID { get; set; }
public int UnitType { get; set; }
/// <summary> /// <summary>
/// 分组名称(医生、护士) /// 分组名称(医生、护士)
/// </summary> /// </summary>
...@@ -37,6 +39,11 @@ public class DoctorResponse ...@@ -37,6 +39,11 @@ public class DoctorResponse
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 科主任/护士长数量
/// </summary>
public Nullable<decimal> ManagerNumber { get; set; }
/// <summary>
/// 核算单元医生数量 /// 核算单元医生数量
/// </summary> /// </summary>
public Nullable<decimal> Number { get; set; } public Nullable<decimal> Number { get; set; }
...@@ -52,6 +59,21 @@ public class DoctorResponse ...@@ -52,6 +59,21 @@ public class DoctorResponse
public Nullable<decimal> SlopeFactor { get; set; } public Nullable<decimal> SlopeFactor { get; set; }
/// <summary> /// <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 /// 其他绩效1
/// </summary> /// </summary>
public Nullable<decimal> OtherPerfor1 { get; set; } public Nullable<decimal> OtherPerfor1 { get; set; }
...@@ -105,5 +127,10 @@ public class DoctorResponse ...@@ -105,5 +127,10 @@ public class DoctorResponse
/// 实发绩效 /// 实发绩效
/// </summary> /// </summary>
public Nullable<decimal> RealGiveFee { get; set; } 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