开发到一半

parent bb7aafec
......@@ -19,15 +19,19 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public virtual DbSet<sys_role> Sys_Role { get; set; }
public virtual DbSet<sys_role_menu> Sys_Role_Menu { get; set; }
public virtual DbSet<sys_user_role> Sys_User_Role { get; set; }
public virtual DbSet<per_allot> per_allot { get; set; }
public virtual DbSet<per_sheet> per_sheet { get; set; }
public virtual DbSet<per_allot> Per_Allot { get; set; }
public virtual DbSet<per_sheet> Per_Sheet { get; set; }
public virtual DbSet<im_employee> Im_Employee { get; set; }
public virtual DbSet<im_header> Im_Header { get; set; }
public virtual DbSet<im_data> Im_Data { get; set; }
public virtual DbSet<im_accountbasic> Im_AccountBasic { get; set; }
public virtual DbSet<res_accountdoctor> res_accountdoctor { get; set; }
public virtual DbSet<res_accountnurse> res_accountnurse { get; set; }
public virtual DbSet<res_accountdoctor> Res_Accountdoctor { get; set; }
public virtual DbSet<res_accountnurse> Res_Accountnurse { get; set; }
public virtual DbSet<cof_drugprop> Cof_DrugProp { get; set; }
public virtual DbSet<cof_income> Cof_Income { get; set; }
public virtual DbSet<cof_director> Cof_Director { get; set; }
public virtual DbSet<res_baiscnorm> Res_Baiscnorm { get; set; }
public virtual DbSet<res_compute> Res_Compute { get; set; }
public virtual DbSet<cof_position> Dic_Position { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" cof_director.cs">
// * FileName: cof_director.cs
// * history : 2019-03-22 15:48:50
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
namespace Performance.EntityModels
{
/// <summary>
/// cof_director Entity Model
/// </summary>
public class cof_director
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public string TypeName { get; set; }
/// <summary>
///
/// </summary>
public string JobTitle { get; set; }
/// <summary>
///
/// </summary>
public Nullable<decimal> Value { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" dic_position.cs">
// * FileName: dic_position.cs
// * history : 2019-03-22 15:48:50
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
namespace Performance.EntityModels
{
/// <summary>
/// dic_position Entity Model
/// </summary>
public class cof_position
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
/// 职位名称
/// </summary>
public string JobTitle { get; set; }
/// <summary>
/// 职位归类 1 院领导 2 行政中层 3 行政工勤 4 临床科室主任 5 临床科室副主任 6 临床科室护士长
/// </summary>
public Nullable<int> JobType { get; set; }
/// <summary>
/// 职位类别 1 普通类别 2 基础绩效来源
/// </summary>
public Nullable<int> State { get; set; }
}
}
......@@ -19,7 +19,12 @@ public class im_accountbasic
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// </summary>
......
......@@ -23,6 +23,11 @@ public class im_data
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> SheetID { get; set; }
/// <summary>
......
......@@ -21,11 +21,21 @@ public class im_employee
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
/// sheet页id
/// </summary>
public Nullable<int> SheetID { get; set; }
/// <summary>
/// 科室类别(例如 医技科室 临床科室 其他科室)
/// </summary>
public string AccountType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
......@@ -83,7 +93,7 @@ public class im_employee
/// <summary>
/// 其他绩效
/// </summary>
public Nullable<decimal> OthePerfor { get; set; }
public Nullable<decimal> OtherPerfor { get; set; }
/// <summary>
/// 医院奖罚
......
......@@ -19,7 +19,12 @@ public class im_header
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// </summary>
......
......@@ -19,7 +19,12 @@ public class res_accountdoctor
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// </summary>
......
......@@ -19,7 +19,12 @@ public class res_accountnurse
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// </summary>
......
//-----------------------------------------------------------------------
// <copyright file=" res_baiscnorm.cs">
// * FileName: res_baiscnorm.cs
// * history : 2019-03-22 15:48:50
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
namespace Performance.EntityModels
{
/// <summary>
/// res_baiscnorm Entity Model
/// </summary>
public class res_baiscnorm
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> SheetID { get; set; }
/// <summary>
/// 绩效核算人群
/// </summary>
public string PositionName { get; set; }
/// <summary>
/// 绩效总额
/// </summary>
public string TotelValue { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public string AvgValue { get; set; }
/// <summary>
/// 总人数
/// </summary>
public Nullable<int> TotelNumber { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" res_compute.cs">
// * FileName: res_compute.cs
// * history : 2019-03-22 16:41:30
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
namespace Performance.EntityModels
{
/// <summary>
/// res_compute Entity Model
/// </summary>
public class res_compute
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
/// sheet页id
/// </summary>
public Nullable<int> SheetID { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 绩效基数核算参考对象
/// </summary>
public Nullable<decimal> FitPeople { get; set; }
/// <summary>
/// 人员姓名
/// </summary>
public string EmployeeName { get; set; }
/// <summary>
/// 绩效合计(来自科室经济测算表)
/// </summary>
public Nullable<decimal> PerforTotal { get; set; }
/// <summary>
/// 核算单元医生数量(来自科室经济测算表)
/// </summary>
public Nullable<decimal> Number { get; set; }
/// <summary>
/// 人均绩效(来自科室经济测算表)
/// </summary>
public Nullable<decimal> Avg { get; set; }
/// <summary>
/// 效率绩效(需计算)
/// </summary>
public Nullable<decimal> Efficiency { get; set; }
/// <summary>
/// 规模绩效(需计算)
/// </summary>
public Nullable<decimal> Scale { get; set; }
/// <summary>
/// 应发管理绩效(需计算)
/// </summary>
public Nullable<decimal> ShouldGiveFee { get; set; }
/// <summary>
/// 发放系数(来自人员名单)
/// </summary>
public Nullable<decimal> Grant { get; set; }
/// <summary>
/// 考核对分率(来自人员名单)
/// </summary>
public Nullable<decimal> ScoreAverageRate { get; set; }
/// <summary>
/// 医院奖罚(来自人员名单)
/// </summary>
public Nullable<decimal> Punishment { get; set; }
/// <summary>
/// 其他绩效(来自人员名单)
/// </summary>
public Nullable<decimal> OtherPerfor { get; set; }
/// <summary>
/// 应发绩效(需计算)
/// </summary>
public Nullable<decimal> GiveFee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" cof_director.cs">
// * FileName: cof_director.cs
// * history : Created by T4 2019-03-22 15:48:55
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// cof_director Repository
/// </summary>
public class PerforCofdirectorRepository : PerforRepository<cof_director>
{
public PerforCofdirectorRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" dic_position.cs">
// * FileName: dic_position.cs
// * history : Created by T4 2019-03-22 15:48:55
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// dic_position Repository
/// </summary>
public class PerforCofpositionRepository : PerforRepository<cof_position>
{
public PerforCofpositionRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" res_baiscnorm.cs">
// * FileName: res_baiscnorm.cs
// * history : Created by T4 2019-03-22 15:48:55
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// res_baiscnorm Repository
/// </summary>
public class PerforResbaiscnormRepository : PerforRepository<res_baiscnorm>
{
public PerforResbaiscnormRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" res_compute.cs">
// * FileName: res_compute.cs
// * history : Created by T4 2019-03-22 15:48:55
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// res_compute Repository
/// </summary>
public class PerforRescomputeRepository : PerforRepository<res_compute>
{
public PerforRescomputeRepository(PerformanceDbContext context) : base(context)
{
}
}
}
using Performance.EntityModels;
using Performance.DtoModels;
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Performance.Services
......@@ -10,9 +12,38 @@ namespace Performance.Services
/// </summary>
public class ComputeDirector
{
public void Compute(List<im_employee> empolyeeList)
public void Compute(List<im_employee> empolyeeList, List<cof_position> positionList,
List<res_accountdoctor> doctorList, List<cof_director> directorList)
{
throw new NotImplementedException();
var positions = positionList.Where(t => t.JobType == (int)EmpolyeeType.Director);
var needCompute = empolyeeList.Where(t => positions.Select(s => s.JobTitle).Contains(t.JobTitle));
foreach (var item in needCompute)
{
var resAccount = doctorList.FirstOrDefault(t => t.AccountingUnit == item.AccountingUnit);
var efficiency = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && positions.Select(s => s.JobTitle).Contains(t.JobTitle));
var scale = directorList.FirstOrDefault(t => t.TypeName == "规模绩效" && positions.Select(s => s.JobTitle).Contains(t.JobTitle));
new res_compute
{
AllotID = item.AllotID,
SheetID = item.SheetID,
AccountingUnit = item.AccountingUnit,
EmployeeName = item.DoctorName,
FitPeople = item.FitPeople,
Number = resAccount?.Number,
PerforTotal = resAccount?.PerforTotal,
Avg = resAccount?.Avg,
Efficiency = efficiency?.Value * resAccount?.Avg,
Scale = scale?.Value * resAccount?.PerforTotal,
Grant = item.Grant,
ShouldGiveFee = (efficiency?.Value * resAccount?.Avg + scale?.Value * resAccount?.PerforTotal) * item.Grant,
//PerforSumFee =
ScoreAverageRate = item.ScoreAverageRate,
Punishment = item.Punishment,
OtherPerfor = item.OtherPerfor,
GiveFee = item.AllotID,
};
}
}
}
}
......@@ -25,6 +25,10 @@ public class PerExcelService : IAutoInjection
private PerforImaccountbasicRepository _perforImaccountbasicRepository;
private PerforResAccountdoctorRepository _perforImaccountdoctorRepository;
private PerforResAccountnurseRepository _perforImaccountnurseRepository;
private PerforCofpositionRepository _perforCofpositionRepository;
private PerforCofdirectorRepository _perforCofdirectorRepository;
private PerforResAccountdoctorRepository _perforResAccountdoctorRepository;
private PerforResAccountnurseRepository _perforResAccountnurseRepository;
public PerExcelService(PerSheetService perSheetService,
PerHeaderService perHeaderService,
PerforPerSheetRepository perforImSheetRepository,
......@@ -33,7 +37,11 @@ public class PerExcelService : IAutoInjection
PerforImEmployeeRepository perforImEmployeeRepository,
PerforImaccountbasicRepository perforImaccountbasicRepository,
PerforResAccountdoctorRepository perforImaccountdoctorRepository,
PerforResAccountnurseRepository perforImaccountnurseRepository)
PerforResAccountnurseRepository perforImaccountnurseRepository,
PerforCofpositionRepository perforCofpositionRepository,
PerforCofdirectorRepository perforCofdirectorRepository,
PerforResAccountdoctorRepository perforResAccountdoctorRepository,
PerforResAccountnurseRepository perforResAccountnurseRepository)
{
_perSheetService = perSheetService;
_perHeaderService = perHeaderService;
......@@ -44,6 +52,10 @@ public class PerExcelService : IAutoInjection
_perforImaccountbasicRepository = perforImaccountbasicRepository;
_perforImaccountdoctorRepository = perforImaccountdoctorRepository;
_perforImaccountnurseRepository = perforImaccountnurseRepository;
_perforCofpositionRepository = perforCofpositionRepository;
_perforResAccountdoctorRepository = perforResAccountdoctorRepository;
_perforResAccountnurseRepository = perforResAccountnurseRepository;
_perforCofdirectorRepository = perforCofdirectorRepository;
}
public void Execute(per_allot allot)
......@@ -298,9 +310,20 @@ public void Compute(per_allot allot, PerExcel excel)
var sheetList = _perforImSheetRepository.GetEntities(t => t.AllotID == allot.ID);
//取出人员信息
var empolyeeList = _perforImEmployeeRepository.GetEntities(t => sheetList.Select(s => s.ID).Contains(t.SheetID.Value));
//人员身份字典
var positionList = _perforCofpositionRepository.GetEntities();
//规模绩效和效率绩效配置表
var directorList = _perforCofdirectorRepository.GetEntities();
//取出
var doctorList = _perforResAccountdoctorRepository.GetEntities(t => t.AllotID == allot.ID);
ComputeDirector computeDirector = new ComputeDirector();
computeDirector.Compute(empolyeeList, positionList, doctorList);
_perforResAccountnurseRepository.GetEntities(t => t.AllotID == allot.ID);
//根据不同人员执行不同算法
//empolyeeList.Where(t=>t.)
//计算院领导、中层管理、工勤人员
......
......@@ -373,7 +373,7 @@ private void EmployeeExport(int sheetID, SheetExportResponse response)
rowbody.Data.Add(new Cell(9, item.Attendance, 1, 1, false, true));
rowbody.Data.Add(new Cell(10, item.PeopleNumber, 1, 1, false, true));
rowbody.Data.Add(new Cell(11, item.Workload, 1, 1, false, true));
rowbody.Data.Add(new Cell(12, item.OthePerfor, 1, 1, false, true));
rowbody.Data.Add(new Cell(12, item.OtherPerfor, 1, 1, false, true));
rowbody.Data.Add(new Cell(13, item.Punishment, 1, 1, false, true));
rowbody.Data.Add(new Cell(14, item.Adjust, 1, 1, false, true));
rowbody.Data.Add(new Cell(15, item.Grant, 1, 1, false, true));
......
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