Commit 8b007359 by ruyun.zhang@suvalue.com

Merge branch 'v2020morge' into custom_script

parents 2d8b7d47 891117c8
...@@ -3,17 +3,14 @@ ...@@ -3,17 +3,14 @@
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;
using Newtonsoft.Json.Linq;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.DtoModels.AppSettings; using Performance.DtoModels.AppSettings;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Security.Claims; using System.Security.Claims;
using System.Threading.Tasks;
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
{ {
......
using FluentValidation.AspNetCore; using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.DtoModels.AppSettings;
using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Services; using Performance.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
{ {
...@@ -21,6 +11,7 @@ public class AssessController : Controller ...@@ -21,6 +11,7 @@ public class AssessController : Controller
private ClaimService claimService; private ClaimService claimService;
private AssessService assessService; private AssessService assessService;
private UserService userService; private UserService userService;
public AssessController(ClaimService claimService, public AssessController(ClaimService claimService,
AssessService assessService, UserService userService) AssessService assessService, UserService userService)
{ {
...@@ -32,7 +23,7 @@ public class AssessController : Controller ...@@ -32,7 +23,7 @@ public class AssessController : Controller
//考核类别列表 //考核类别列表
[HttpPost] [HttpPost]
[Route("assesslist")] [Route("assesslist")]
public ApiResponse AssessList([CustomizeValidator(RuleSet = "List"), FromBody]AssessRequest request) public ApiResponse AssessList([CustomizeValidator(RuleSet = "List"), FromBody] AssessRequest request)
{ {
return assessService.AssessList(request.AllotID); return assessService.AssessList(request.AllotID);
} }
...@@ -40,7 +31,7 @@ public ApiResponse AssessList([CustomizeValidator(RuleSet = "List"), FromBody]As ...@@ -40,7 +31,7 @@ public ApiResponse AssessList([CustomizeValidator(RuleSet = "List"), FromBody]As
//新增考核类别 //新增考核类别
[HttpPost] [HttpPost]
[Route("addassess")] [Route("addassess")]
public ApiResponse AddAssess([CustomizeValidator(RuleSet = "Add"), FromBody]AssessRequest request) public ApiResponse AddAssess([CustomizeValidator(RuleSet = "Add"), FromBody] AssessRequest request)
{ {
return assessService.AddAssess(request.AllotID, request.AssessName); return assessService.AddAssess(request.AllotID, request.AssessName);
} }
...@@ -48,7 +39,7 @@ public ApiResponse AddAssess([CustomizeValidator(RuleSet = "Add"), FromBody]Asse ...@@ -48,7 +39,7 @@ public ApiResponse AddAssess([CustomizeValidator(RuleSet = "Add"), FromBody]Asse
//修改考核类别 //修改考核类别
[HttpPost] [HttpPost]
[Route("editassess")] [Route("editassess")]
public ApiResponse EditAssess([CustomizeValidator(RuleSet = "Update"), FromBody]AssessRequest request) public ApiResponse EditAssess([CustomizeValidator(RuleSet = "Update"), FromBody] AssessRequest request)
{ {
return assessService.EditAssess(request.AssessID, request.AssessName); return assessService.EditAssess(request.AssessID, request.AssessName);
} }
...@@ -56,7 +47,7 @@ public ApiResponse EditAssess([CustomizeValidator(RuleSet = "Update"), FromBody] ...@@ -56,7 +47,7 @@ public ApiResponse EditAssess([CustomizeValidator(RuleSet = "Update"), FromBody]
//删除考核类别 //删除考核类别
[HttpPost] [HttpPost]
[Route("delassess")] [Route("delassess")]
public ApiResponse DelAssess([CustomizeValidator(RuleSet = "Del"), FromBody]AssessRequest request) public ApiResponse DelAssess([CustomizeValidator(RuleSet = "Del"), FromBody] AssessRequest request)
{ {
return assessService.DelAssess(request.AssessID); return assessService.DelAssess(request.AssessID);
} }
...@@ -64,7 +55,7 @@ public ApiResponse DelAssess([CustomizeValidator(RuleSet = "Del"), FromBody]Asse ...@@ -64,7 +55,7 @@ public ApiResponse DelAssess([CustomizeValidator(RuleSet = "Del"), FromBody]Asse
//获取所有科室列表 //获取所有科室列表
[HttpPost] [HttpPost]
[Route("departmentlist")] [Route("departmentlist")]
public ApiResponse DepartmentList([CustomizeValidator(RuleSet = "Use"), FromBody]AssessRequest request) public ApiResponse DepartmentList([CustomizeValidator(RuleSet = "Use"), FromBody] AssessRequest request)
{ {
var department = assessService.Department(request); var department = assessService.Department(request);
return new ApiResponse(ResponseType.OK, "ok", department); return new ApiResponse(ResponseType.OK, "ok", department);
...@@ -73,7 +64,7 @@ public ApiResponse DepartmentList([CustomizeValidator(RuleSet = "Use"), FromBody ...@@ -73,7 +64,7 @@ public ApiResponse DepartmentList([CustomizeValidator(RuleSet = "Use"), FromBody
//设置科室考核分类 //设置科室考核分类
[HttpPost] [HttpPost]
[Route("setassesstype")] [Route("setassesstype")]
public ApiResponse SetAssessType([FromBody]SetAssessRequest request) public ApiResponse SetAssessType([FromBody] SetAssessRequest request)
{ {
return assessService.SetAssessType(request); return assessService.SetAssessType(request);
} }
...@@ -81,7 +72,7 @@ public ApiResponse SetAssessType([FromBody]SetAssessRequest request) ...@@ -81,7 +72,7 @@ public ApiResponse SetAssessType([FromBody]SetAssessRequest request)
//考核列头列表 //考核列头列表
[HttpPost] [HttpPost]
[Route("columnlist")] [Route("columnlist")]
public ApiResponse ColumnList([CustomizeValidator(RuleSet = "List"), FromBody]AssessColumnRequest request) public ApiResponse ColumnList([CustomizeValidator(RuleSet = "List"), FromBody] AssessColumnRequest request)
{ {
return assessService.ColumnList(request.AssessID); return assessService.ColumnList(request.AssessID);
} }
...@@ -89,7 +80,7 @@ public ApiResponse ColumnList([CustomizeValidator(RuleSet = "List"), FromBody]As ...@@ -89,7 +80,7 @@ public ApiResponse ColumnList([CustomizeValidator(RuleSet = "List"), FromBody]As
//新增考核项 //新增考核项
[HttpPost] [HttpPost]
[Route("addcolumn")] [Route("addcolumn")]
public ApiResponse AddColumn([CustomizeValidator(RuleSet = "Add"), FromBody]AssessColumnRequest request) public ApiResponse AddColumn([CustomizeValidator(RuleSet = "Add"), FromBody] AssessColumnRequest request)
{ {
return assessService.AddColumn(request.AssessID, request.ParentID, request.ColumnName, request.Sort); return assessService.AddColumn(request.AssessID, request.ParentID, request.ColumnName, request.Sort);
} }
...@@ -97,7 +88,7 @@ public ApiResponse AddColumn([CustomizeValidator(RuleSet = "Add"), FromBody]Asse ...@@ -97,7 +88,7 @@ public ApiResponse AddColumn([CustomizeValidator(RuleSet = "Add"), FromBody]Asse
//修改考核项 //修改考核项
[HttpPost] [HttpPost]
[Route("editcolumn")] [Route("editcolumn")]
public ApiResponse EditColumn([CustomizeValidator(RuleSet = "Update"), FromBody]AssessColumnRequest request) public ApiResponse EditColumn([CustomizeValidator(RuleSet = "Update"), FromBody] AssessColumnRequest request)
{ {
return assessService.EditColumn(request.ColumnID, request.ColumnName, request.Sort); return assessService.EditColumn(request.ColumnID, request.ColumnName, request.Sort);
} }
...@@ -105,7 +96,7 @@ public ApiResponse EditColumn([CustomizeValidator(RuleSet = "Update"), FromBody] ...@@ -105,7 +96,7 @@ public ApiResponse EditColumn([CustomizeValidator(RuleSet = "Update"), FromBody]
//删除考核项 //删除考核项
[HttpPost] [HttpPost]
[Route("delcolumn")] [Route("delcolumn")]
public ApiResponse DelColumn([CustomizeValidator(RuleSet = "Del"), FromBody]AssessColumnRequest request) public ApiResponse DelColumn([CustomizeValidator(RuleSet = "Del"), FromBody] AssessColumnRequest request)
{ {
return assessService.DelColumn(request.ColumnID); return assessService.DelColumn(request.ColumnID);
} }
...@@ -113,7 +104,7 @@ public ApiResponse DelColumn([CustomizeValidator(RuleSet = "Del"), FromBody]Asse ...@@ -113,7 +104,7 @@ public ApiResponse DelColumn([CustomizeValidator(RuleSet = "Del"), FromBody]Asse
//考核数据列表 //考核数据列表
[HttpPost] [HttpPost]
[Route("datalist")] [Route("datalist")]
public ApiResponse DataList([CustomizeValidator(RuleSet = "List"), FromBody]AssessDataRequest request) public ApiResponse DataList([CustomizeValidator(RuleSet = "List"), FromBody] AssessDataRequest request)
{ {
return assessService.DataList(request.AssessID); return assessService.DataList(request.AssessID);
} }
...@@ -121,7 +112,7 @@ public ApiResponse DataList([CustomizeValidator(RuleSet = "List"), FromBody]Asse ...@@ -121,7 +112,7 @@ public ApiResponse DataList([CustomizeValidator(RuleSet = "List"), FromBody]Asse
//考核数据修改 //考核数据修改
[HttpPost] [HttpPost]
[Route("editassessdata")] [Route("editassessdata")]
public ApiResponse EditAssessData([CustomizeValidator(RuleSet = "Edit"), FromBody]AssessDataRequest request) public ApiResponse EditAssessData([CustomizeValidator(RuleSet = "Edit"), FromBody] AssessDataRequest request)
{ {
return assessService.EditAssessData(request.AssessRow); return assessService.EditAssessData(request.AssessRow);
} }
...@@ -137,7 +128,7 @@ public ApiResponse TempAssessList() ...@@ -137,7 +128,7 @@ public ApiResponse TempAssessList()
//模板列头列表 //模板列头列表
[HttpPost] [HttpPost]
[Route("tempcolumnlist")] [Route("tempcolumnlist")]
public ApiResponse TempColumnList([CustomizeValidator(RuleSet = "List"), FromBody]AssessColumnRequest request) public ApiResponse TempColumnList([CustomizeValidator(RuleSet = "List"), FromBody] AssessColumnRequest request)
{ {
return assessService.TempColumnList(request.AssessID); return assessService.TempColumnList(request.AssessID);
} }
...@@ -145,9 +136,9 @@ public ApiResponse TempColumnList([CustomizeValidator(RuleSet = "List"), FromBod ...@@ -145,9 +136,9 @@ public ApiResponse TempColumnList([CustomizeValidator(RuleSet = "List"), FromBod
//使用考核模版 //使用考核模版
[HttpPost] [HttpPost]
[Route("usetemplate")] [Route("usetemplate")]
public ApiResponse UseTemplate([CustomizeValidator(RuleSet = "Use"), FromBody]AssessRequest request) public ApiResponse UseTemplate([CustomizeValidator(RuleSet = "Use"), FromBody] AssessRequest request)
{ {
return assessService.UseTemplate(request.AllotID, request.AssessID); return assessService.UseTemplate(request.AllotID, request.AssessID);
} }
} }
} }
\ No newline at end of file
...@@ -296,6 +296,8 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request) ...@@ -296,6 +296,8 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request)
JobNumber = t.Key.JobNumber, JobNumber = t.Key.JobNumber,
PerforSumFee = t.Sum(s => s.PerforSumFee), PerforSumFee = t.Sum(s => s.PerforSumFee),
PerforManagementFee = t.Sum(s => s.PerforManagementFee), PerforManagementFee = t.Sum(s => s.PerforManagementFee),
Adjust = t.FirstOrDefault()?.Adjust ?? 0,
AdjustLaterOtherFee = t.Sum(s => s.AdjustLaterOtherFee),
ShouldGiveFee = t.Sum(s => s.ShouldGiveFee), ShouldGiveFee = t.Sum(s => s.ShouldGiveFee),
OthePerfor = t.Sum(s => s.OthePerfor), OthePerfor = t.Sum(s => s.OthePerfor),
NightWorkPerfor = t.Sum(s => s.NightWorkPerfor), NightWorkPerfor = t.Sum(s => s.NightWorkPerfor),
......
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Performance.DtoModels; using Performance.DtoModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
{ {
...@@ -19,4 +15,4 @@ public ActionResult<ApiResponse> Get() ...@@ -19,4 +15,4 @@ public ActionResult<ApiResponse> Get()
return new ApiResponse(ResponseType.NotFound, "not found"); return new ApiResponse(ResponseType.NotFound, "not found");
} }
} }
} }
\ No newline at end of file
using AutoMapper; using AutoMapper;
using FluentValidation; using FluentValidation;
using FluentValidation.AspNetCore; using FluentValidation.AspNetCore;
using Hangfire;
using Hangfire.MySql.Core;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using NLog;
using NLog.Extensions.Logging; using NLog.Extensions.Logging;
using NLog.Web;
using Performance.DtoModels;
using Performance.DtoModels.AppSettings; using Performance.DtoModels.AppSettings;
using Performance.DtoModels.AutoMapper; using Performance.DtoModels.AutoMapper;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository;
using Performance.Services; using Performance.Services;
using Performance.Services.Queues; using Performance.Services.Queues;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
...@@ -28,12 +21,8 @@ ...@@ -28,12 +21,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Performance.Api namespace Performance.Api
{ {
......
...@@ -19,17 +19,16 @@ public class PerSheetHeader ...@@ -19,17 +19,16 @@ public class PerSheetHeader
("绩效基数核算参考对象", (t) => t.FitPeople, 1, 1, false, false, false, "FitPeople"), ("绩效基数核算参考对象", (t) => t.FitPeople, 1, 1, false, false, false, "FitPeople"),
("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"), ("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"),
//("参加工作时间", (t) => t.WorkTime, 1, 1, false, false, false, "WorkTime"), //("参加工作时间", (t) => t.WorkTime, 1, 1, false, false, false, "WorkTime"),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2) , 1, 1, false, true, true, "ScoreAverageRate"), ("考核得分率", (t) => Math.Round((t.ScoreAverageRate ?? 1) * 100, 2) , 1, 1, false, true, true, "ScoreAverageRate"),
("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2), 1, 1, false, true, true, "Attendance"), ("出勤率", (t) => Math.Round((t.Attendance ?? 0) * 100, 2), 1, 1, false, true, true, "Attendance"),
//("核算单元医生数", (t) => t.PeopleNumber, 1, 1, false, true, false, "PeopleNumber"), //("核算单元医生数", (t) => t.PeopleNumber, 1, 1, false, true, false, "PeopleNumber"),
//("工作量绩效", (t) =>t.Workload, 1, 1, false, true, false, "Workload"), //("工作量绩效", (t) =>t.Workload, 1, 1, false, true, false, "Workload"),
//("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"), //("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"),
//("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false, "Punishment"), //("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false, "Punishment"),
("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2), 1, 1, false, true, true, "Adjust"), ("调节系数", (t) => Math.Round((t.Adjust ?? 1) * 100, 2), 1, 1, false, true, true, "Adjust"),
//("发放系数", (t) => t.Grant, 1, 1, false, true, false, "Grant"), //("发放系数", (t) => t.Grant, 1, 1, false, true, false, "Grant"),
}; };
// Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal, isNumValue, 是否含有% // Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal, isNumValue, 是否含有%
public static List<(string, Func<im_employee_clinic, object>, int, int, bool, bool, bool, string)> employeeClinicHeaders = public static List<(string, Func<im_employee_clinic, object>, int, int, bool, bool, bool, string)> employeeClinicHeaders =
new List<(string, Func<im_employee_clinic, object>, int, int, bool, bool, bool, string)> new List<(string, Func<im_employee_clinic, object>, int, int, bool, bool, bool, string)>
...@@ -40,13 +39,13 @@ public class PerSheetHeader ...@@ -40,13 +39,13 @@ public class PerSheetHeader
("医生姓名", (t) => t.DoctorName, 1, 1, false, false, false, "DoctorName"), ("医生姓名", (t) => t.DoctorName, 1, 1, false, false, false, "DoctorName"),
("职务分类", (t) => t.JobTitle, 1, 1, false, true, false, "JobTitle"), ("职务分类", (t) => t.JobTitle, 1, 1, false, true, false, "JobTitle"),
//("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"), //("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"),
("基础绩效系数", (t) => Math.Round(t.Basics.Value * 100, 2), 1, 1, false, true, false, "Basics"), ("基础绩效系数", (t) => Math.Round((t.Basics ?? 1) * 100, 2), 1, 1, false, true, false, "Basics"),
("效率绩效人数", (t) => t.PermanentStaff, 1, 1, false, true, false, "PermanentStaff"), ("效率绩效人数", (t) => t.PermanentStaff, 1, 1, false, true, false, "PermanentStaff"),
("效率绩效系数", (t) => Math.Round(t.Efficiency.Value * 100, 2), 1, 1, false, true, true, "Efficiency"), ("效率绩效系数", (t) => Math.Round((t.Efficiency ?? 0) * 100, 2), 1, 1, false, true, true, "Efficiency"),
("规模绩效系数", (t) => Math.Round(t.Scale.Value * 100, 2), 1, 1, false, true, true, "Scale"), ("规模绩效系数", (t) => Math.Round((t.Scale ?? 0) * 100, 2), 1, 1, false, true, true, "Scale"),
("管理绩效发放系数", (t) => Math.Round(t.Management.Value * 100, 2), 1, 1, false, true, true, "Management"), ("管理绩效发放系数", (t) => Math.Round((t.Management ?? 1) * 100, 2), 1, 1, false, true, true, "Management"),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2), 1, 1, false, true, true, "ScoreAverageRate"), ("考核得分率", (t) => Math.Round((t.ScoreAverageRate ?? 1) * 100, 2), 1, 1, false, true, true, "ScoreAverageRate"),
("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2), 1, 1, false, true, true, "Attendance"), ("出勤率", (t) => Math.Round((t.Attendance ?? 0) * 100, 2), 1, 1, false, true, true, "Attendance"),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"), ("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"),
//("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false, "Punishment"), //("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false, "Punishment"),
("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2), 1, 1, false, true, true, "Adjust"), ("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2), 1, 1, false, true, true, "Adjust"),
...@@ -65,7 +64,7 @@ public class PerSheetHeader ...@@ -65,7 +64,7 @@ public class PerSheetHeader
("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"), ("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"),
//("参加工作时间", (t) => t.WorkTime, 1, 1, false, false, false, "WorkTime"), //("参加工作时间", (t) => t.WorkTime, 1, 1, false, false, false, "WorkTime"),
//("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2) , 1, 1, false, true, true, "ScoreAverageRate"), //("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2) , 1, 1, false, true, true, "ScoreAverageRate"),
("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2), 1, 1, false, true, true, "Attendance"), ("出勤率", (t) => Math.Round((t.Attendance ?? 0) * 100, 2), 1, 1, false, true, true, "Attendance"),
//("核算单元医生数", (t) => t.PeopleNumber, 1, 1, false, true, false, "PeopleNumber"), //("核算单元医生数", (t) => t.PeopleNumber, 1, 1, false, true, false, "PeopleNumber"),
//("工作量绩效", (t) =>t.Workload, 1, 1, false, true, false, "Workload"), //("工作量绩效", (t) =>t.Workload, 1, 1, false, true, false, "Workload"),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"), ("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false, "OtherPerfor"),
...@@ -74,7 +73,6 @@ public class PerSheetHeader ...@@ -74,7 +73,6 @@ public class PerSheetHeader
//("发放系数", (t) => t.Grant, 1, 1, false, true, false, "Grant"), //("发放系数", (t) => t.Grant, 1, 1, false, true, false, "Grant"),
}; };
// Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal, isNumValue, 是否含有% // Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal, isNumValue, 是否含有%
public static List<(string, Func<im_specialunit, object>, int, int, bool, bool, bool, string)> specialUnitHeaders = public static List<(string, Func<im_specialunit, object>, int, int, bool, bool, bool, string)> specialUnitHeaders =
new List<(string, Func<im_specialunit, object>, int, int, bool, bool, bool, string)> new List<(string, Func<im_specialunit, object>, int, int, bool, bool, bool, string)>
......
...@@ -200,7 +200,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -200,7 +200,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
//Punishment = (extra ?? 0), //Punishment = (extra ?? 0),
//MedicineExtra = (drugExtra ?? 0), //MedicineExtra = (drugExtra ?? 0),
//MaterialsExtra = (materialsExtra ?? 0), //MaterialsExtra = (materialsExtra ?? 0),
Punishment = 0, Punishment = dept?.Extra ?? 0,
MedicineExtra = dept?.MedicineExtra ?? 0, MedicineExtra = dept?.MedicineExtra ?? 0,
MaterialsExtra = dept?.MaterialsExtra ?? 0, MaterialsExtra = dept?.MaterialsExtra ?? 0,
......
...@@ -500,6 +500,8 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i ...@@ -500,6 +500,8 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i
var types1 = new List<string> { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString() }; var types1 = new List<string> { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString() };
var types2 = new List<string> { AccountUnitType.行政中层.ToString(), AccountUnitType.行政高层.ToString() }; var types2 = new List<string> { AccountUnitType.行政中层.ToString(), AccountUnitType.行政高层.ToString() };
var types3 = (hospital?.IsOpenLogisticsSecondAllot != 1) ? new List<string> { AccountUnitType.行政工勤.ToString() } : new List<string>();
//// 业务中层人员信息 //// 业务中层人员信息
//var empolyeeList = _perforImemployeeclinicRepository.GetEntities(t => t.AllotID == allotId); //var empolyeeList = _perforImemployeeclinicRepository.GetEntities(t => t.AllotID == allotId);
// 一次绩效 获取特定人员绩效结果 // 一次绩效 获取特定人员绩效结果
...@@ -515,7 +517,11 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i ...@@ -515,7 +517,11 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i
// 行政中层 行政高层 补充 夜班费 // 行政中层 行政高层 补充 夜班费
if (types2.Contains(t.AccountType)) if (types2.Contains(t.AccountType))
{
comp.PerforSumFee = t.GiveFee;
comp.PerforManagementFee = 0;
comp.NightWorkPerfor = t.NightWorkPerfor; comp.NightWorkPerfor = t.NightWorkPerfor;
}
// 科主任/护士长 // 科主任/护士长
if (types1.Contains(t.AccountType)) if (types1.Contains(t.AccountType))
...@@ -528,6 +534,13 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i ...@@ -528,6 +534,13 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i
else else
comp.PerforSumFee = t.Avg; comp.PerforSumFee = t.Avg;
} }
// 行政工勤
if (types3.Contains(t.AccountType))
{
comp.PerforSumFee = t.GiveFee;
comp.AdjustLaterOtherFee = 0;
comp.PerforManagementFee = 0;
}
return comp; return comp;
}).ToList(); }).ToList();
......
...@@ -14,7 +14,6 @@ public class SpecialUnitDataWrite : ISheetDataWrite ...@@ -14,7 +14,6 @@ public class SpecialUnitDataWrite : ISheetDataWrite
{ {
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects) public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
{ {
} }
public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, object data, Dictionary<ExDataDict, object> exdict = null) public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, object data, Dictionary<ExDataDict, object> exdict = null)
...@@ -53,7 +52,6 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp ...@@ -53,7 +52,6 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
} }
catch (Exception) catch (Exception)
{ {
} }
} }
...@@ -119,14 +117,9 @@ private void SupplyMergedRegionData(ISheet sheet, ExcelStyle style, List<Special ...@@ -119,14 +117,9 @@ private void SupplyMergedRegionData(ISheet sheet, ExcelStyle style, List<Special
var basicStyle = style.GetCellStyle(); var basicStyle = style.GetCellStyle();
foreach (var merged in mergedRegions.Where(t => t.FirstRow > 1)) foreach (var merged in mergedRegions.Where(t => t.FirstRow > 1))
{ {
string value = ""; CellType cellType = CellType.Unknown;
var valueCell = sheet.GetRow(merged.FirstRow)?.GetCell(merged.FirstColumn); var valueCell = sheet.GetRow(merged.FirstRow)?.GetCell(merged.FirstColumn);
if (valueCell != null)
{ string value = valueCell != null ? valueCell.ToString() : "";
cellType = valueCell.CellType;
valueCell.SetCellType(CellType.String);
value = valueCell.StringCellValue;
}
merged.Single = value; merged.Single = value;
if (string.IsNullOrEmpty(value)) continue; if (string.IsNullOrEmpty(value)) continue;
...@@ -187,6 +180,7 @@ private void SupplySpecialQuantity(ISheet sheet, ExcelStyle style, List<SpecialD ...@@ -187,6 +180,7 @@ private void SupplySpecialQuantity(ISheet sheet, ExcelStyle style, List<SpecialD
if (special != null) if (special != null)
{ {
var cell = row.GetOrCreate(quantityIndex); var cell = row.GetOrCreate(quantityIndex);
cell.SetCellType(CellType.Numeric);
cell.SetCellValue<double>(special.Quantity); cell.SetCellValue<double>(special.Quantity);
cell.CellStyle = cellStyle; cell.CellStyle = cellStyle;
...@@ -291,7 +285,10 @@ private void WriteSpecialData(IRow row, ICellStyle style, SpecialDto special, Li ...@@ -291,7 +285,10 @@ private void WriteSpecialData(IRow row, ICellStyle style, SpecialDto special, Li
if (new string[] { SpecialUnitColumns.Department, SpecialUnitColumns.Target }.Contains(item.Key)) if (new string[] { SpecialUnitColumns.Department, SpecialUnitColumns.Target }.Contains(item.Key))
cell.SetCellValue(item.Value.Invoke(special)?.ToString()); cell.SetCellValue(item.Value.Invoke(special)?.ToString());
else else
{
cell.SetCellType(CellType.Numeric);
cell.SetCellValue<double>(item.Value.Invoke(special)); cell.SetCellValue<double>(item.Value.Invoke(special));
}
cell.CellStyle = style; cell.CellStyle = style;
} }
} }
...@@ -326,14 +323,20 @@ private void AddMergedRegion(ISheet sheet, List<SpecialCellRange> ranges, List<s ...@@ -326,14 +323,20 @@ private void AddMergedRegion(ISheet sheet, List<SpecialCellRange> ranges, List<s
public void SetCellValue(ICell cell, string value) public void SetCellValue(ICell cell, string value)
{ {
switch (value) if (string.IsNullOrEmpty(value)) return;
switch (value.Trim())
{ {
case string reg when Regex.IsMatch(reg, @"^[+-]?\d*[.]?\d*$"): case string reg when Regex.IsMatch(reg, @"^[+-]?\d*[.]?\d*$"):
cell.SetCellType(CellType.Numeric);
cell.SetCellValue(ConvertHelper.To<double>(value)); cell.SetCellValue(ConvertHelper.To<double>(value));
break; break;
case string reg when Regex.IsMatch(reg, @"^[+-]?\d*$"): case string reg when Regex.IsMatch(reg, @"^[+-]?\d*$"):
cell.SetCellType(CellType.Numeric);
cell.SetCellValue(ConvertHelper.To<int>(value)); cell.SetCellValue(ConvertHelper.To<int>(value));
break; break;
default: default:
cell.SetCellValue(value); cell.SetCellValue(value);
break; break;
......
...@@ -78,6 +78,7 @@ public PerSheet Sheet(ISheet sheet, bool isnew) ...@@ -78,6 +78,7 @@ public PerSheet Sheet(ISheet sheet, bool isnew)
/// <returns></returns> /// <returns></returns>
public SheetType GetSheetType(string sheetName) public SheetType GetSheetType(string sheetName)
{ {
sheetName = sheetName.TrimStart();
if (sheetName.StartsWith("行政中高层")) if (sheetName.StartsWith("行政中高层"))
return SheetType.Employee; return SheetType.Employee;
else if (sheetName.StartsWith("业务中层")) else if (sheetName.StartsWith("业务中层"))
......
...@@ -401,12 +401,12 @@ private List<BodyItem> GetEmployees(List<per_employee> employees, int allotId, i ...@@ -401,12 +401,12 @@ private List<BodyItem> GetEmployees(List<per_employee> employees, int allotId, i
if (!string.IsNullOrEmpty(empName)) if (!string.IsNullOrEmpty(empName))
employees = employees?.Where(w => w.DoctorName?.Trim() == empName?.Trim()).ToList(); employees = employees?.Where(w => w.DoctorName?.Trim() == empName?.Trim()).ToList();
if (!string.IsNullOrEmpty(jobNumber)) if (!string.IsNullOrEmpty(jobNumber))
employees = employees?.Where(w => !string.IsNullOrEmpty(w.PersonnelNumber) && w.PersonnelNumber == jobNumber.Trim()).ToList(); employees = employees?.Where(w => !string.IsNullOrEmpty(w.JobNumber) && w.JobNumber.Trim() == jobNumber.Trim()).ToList();
var second = perforAgsecondallotRepository.GetEntity(t => t.AllotId == allotId); var second = perforAgsecondallotRepository.GetEntity(t => t.AllotId == allotId);
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == 3); var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == 3);
Func<per_employee, decimal?> getAprAmount = (t) => perapramounts Func<per_employee, decimal?> getAprAmount = (t) => perapramounts
?.Where(w => w.AccountingUnit?.Trim() == second.Department?.Trim() && w.DoctorName?.Trim() == t.DoctorName?.Trim() && w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim()) ?.Where(w => w.AccountingUnit?.Trim() == second.Department?.Trim() && w.DoctorName?.Trim() == t.DoctorName?.Trim() && w.PersonnelNumber?.Trim() == t.JobNumber?.Trim())
?.Sum(w => w.Amount); ?.Sum(w => w.Amount);
Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>> Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>>
...@@ -1562,7 +1562,7 @@ public List<ag_othersource> OtherAutoComplete(SecondEmpRequest request, int user ...@@ -1562,7 +1562,7 @@ public List<ag_othersource> OtherAutoComplete(SecondEmpRequest request, int user
if (!string.IsNullOrEmpty(request.EmployeeName)) if (!string.IsNullOrEmpty(request.EmployeeName))
employees = employees?.Where(w => w.DoctorName?.Trim() == request.EmployeeName?.Trim()).ToList(); employees = employees?.Where(w => w.DoctorName?.Trim() == request.EmployeeName?.Trim()).ToList();
if (!string.IsNullOrEmpty(request.JobNumber)) if (!string.IsNullOrEmpty(request.JobNumber))
employees = employees?.Where(w => !string.IsNullOrEmpty(w.PersonnelNumber) && w.PersonnelNumber == request.JobNumber.Trim()).ToList(); employees = employees?.Where(w => !string.IsNullOrEmpty(w.JobNumber) && w.JobNumber.Trim() == request.JobNumber.Trim()).ToList();
List<ag_othersource> result = employees List<ag_othersource> result = employees
.Select(t => new ag_othersource .Select(t => new ag_othersource
...@@ -1757,16 +1757,16 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId, out ...@@ -1757,16 +1757,16 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId, out
var empDic = peremployeeRepository.GetEntities(w => w.AllotId == allotId); var empDic = peremployeeRepository.GetEntities(w => w.AllotId == allotId);
foreach (var item in result) foreach (var item in result)
{ {
var perfor = ((item.GiveFee ?? 0) != 0 ? item.GiveFee : item.PerforSumFee) ?? 0;
item.PerforSumFee = Math.Round(item.PerforSumFee ?? 0, 0, MidpointRounding.AwayFromZero); item.PerforSumFee = Math.Round(item.PerforSumFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.PerforManagementFee = Math.Round(item.PerforManagementFee ?? 0, 0, MidpointRounding.AwayFromZero); item.PerforManagementFee = Math.Round(item.PerforManagementFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.GiveFee = Math.Round(perfor, 0, MidpointRounding.AwayFromZero); var real = Math.Round((item.PerforSumFee ?? 0) + (item.PerforManagementFee ?? 0), 0) * item.Adjust + (item.AdjustLaterOtherFee ?? 0);
item.AdjustLaterOtherFee = Math.Round(item.AdjustLaterOtherFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.OthePerfor = Math.Round(item.OthePerfor ?? 0, 0, MidpointRounding.AwayFromZero); item.OthePerfor = Math.Round(item.OthePerfor ?? 0, 0, MidpointRounding.AwayFromZero);
item.NightWorkPerfor = Math.Round(item.NightWorkPerfor ?? 0, 0, MidpointRounding.AwayFromZero); item.NightWorkPerfor = Math.Round(item.NightWorkPerfor ?? 0, 0, MidpointRounding.AwayFromZero);
item.ShouldGiveFee = Math.Round((perfor + item.AdjustLaterOtherFee + item.NightWorkPerfor) ?? 0, 0, MidpointRounding.AwayFromZero); item.ShouldGiveFee = Math.Round((real ?? 0) + (item.OthePerfor ?? 0) + (item.NightWorkPerfor ?? 0), 0, MidpointRounding.AwayFromZero);
item.RealGiveFee = Math.Round((perfor + item.AdjustLaterOtherFee + item.NightWorkPerfor) ?? 0, 0, MidpointRounding.AwayFromZero); item.ReservedRatio = empDic?.FirstOrDefault(w => w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0;
item.ReservedRatioFee = Math.Round((real ?? 0) * (item.ReservedRatio ?? 0), 0, MidpointRounding.AwayFromZero);
item.RealGiveFee = Math.Round(item.ShouldGiveFee - (item.ReservedRatioFee ?? 0) ?? 0, 0, MidpointRounding.AwayFromZero);
} }
} }
...@@ -1788,43 +1788,40 @@ private List<SecondPerforResponse> GetAllotPerformance(int allotId, List<res_com ...@@ -1788,43 +1788,40 @@ private List<SecondPerforResponse> GetAllotPerformance(int allotId, List<res_com
var empolyeeList = imemployeeclinicRepository.GetEntities(t => t.AllotID == allotId); var empolyeeList = imemployeeclinicRepository.GetEntities(t => t.AllotID == allotId);
return computes.Select(t => return computes.Select(t =>
{ {
var comp = new SecondPerforResponse() var comp = new SecondPerforResponse()
{ {
AccountingUnit = t.AccountingUnit, AccountingUnit = t.AccountingUnit,
EmployeeName = t.EmployeeName, EmployeeName = t.EmployeeName,
JobNumber = t.JobNumber, JobNumber = t.JobNumber,
JobTitle = t.JobTitle, JobTitle = t.JobTitle,
UnitType = t.AccountType, UnitType = t.AccountType,
Scale = t.Scale, Adjust = t.Adjust,
Efficiency = t.Efficiency, AdjustLaterOtherFee = t.AdjustLaterOtherFee,
Grant = t.Grant, Scale = t.Scale,
Punishment = t.Punishment, Efficiency = t.Efficiency,
ShouldGiveFee = t.ShouldGiveFee, Grant = t.Grant,
PerforSumFee = t.PerforSumFee, ShouldGiveFee = t.ShouldGiveFee,
GiveFee = t.GiveFee * t.Adjust, };
AdjustLaterOtherFee = t.AdjustLaterOtherFee ?? 0,
OthePerfor = t.OtherPerfor, // 行政中层 行政高层 补充 夜班费
RealGiveFee = t.RealGiveFee if (types2.Contains(t.AccountType))
}; comp.NightWorkPerfor = t.NightWorkPerfor;
if (types1.Contains(t.AccountType)) // 科主任/护士长
comp.PerforManagementFee = ((t.Efficiency + t.Scale) * t.Grant + t.OtherManagePerfor) * t.Attendance * t.ScoreAverageRate; if (types1.Contains(t.AccountType))
else {
comp.PerforManagementFee = t.RealGiveFee; // 等同于考核后管理绩效 AssessLaterManagementFee
// 行政中层 行政高层 补充 夜班费 comp.PerforManagementFee = Math.Round(t.ShouldGiveFee * t.ScoreAverageRate * t.Attendance + t.Punishment ?? 0);
if (types2.Contains(t.AccountType)) // 仅显示管理绩效
comp.NightWorkPerfor = t.NightWorkPerfor; if (isShowManage == 2)
// 获取科主任系数,解决共用科主任重复计算人均问题 comp.PerforSumFee = 0;
var basics = empolyeeList?.FirstOrDefault(w => w.AccountingUnit == t.AccountingUnit && w.DoctorName == t.EmployeeName && w.PersonnelNumber == t.JobNumber)?.Basics; else
// 仅显示管理绩效 comp.PerforSumFee = t.Avg;
if (isShowManage == 2) }
comp.PerforSumFee = 0;
else return comp;
comp.PerforSumFee = Math.Round((t.Avg * (basics ?? 1)) + t.ShouldGiveFee + t.AssessBeforeOtherFee ?? 0); }).ToList();
return comp;
}).ToList();
} }
public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforResponse> computes) public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforResponse> computes)
...@@ -1849,4 +1846,4 @@ public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforRes ...@@ -1849,4 +1846,4 @@ public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforRes
return computes; return computes;
} }
} }
} }
\ No newline at end of file
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