Commit 06d34934 by lcx

Merge branch '科室分配' into 单元格修改

# Conflicts:
#	performance/Performance.EntityModels/Entity/im_data.cs
#	performance/Performance.EntityModels/Entity/im_employee.cs
#	performance/Performance.EntityModels/Entity/im_employee_clinic.cs
#	performance/Performance.EntityModels/Entity/im_header.cs
#	performance/Performance.EntityModels/Entity/im_specialunit.cs
parents 2f2e0955 8c41b20b
...@@ -54,6 +54,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options) ...@@ -54,6 +54,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public virtual DbSet<cof_again> cof_again { get; set; } public virtual DbSet<cof_again> cof_again { get; set; }
/// <summary> 上传excel文件校验配置 </summary> /// <summary> 上传excel文件校验配置 </summary>
public virtual DbSet<cof_check> cof_check { get; set; } public virtual DbSet<cof_check> cof_check { get; set; }
/// <summary> 科室类型 </summary>
public virtual DbSet<cof_depttype> cof_depttype { get; set; }
/// <summary> 规模绩效、效率绩效计算系数配置 </summary> /// <summary> 规模绩效、效率绩效计算系数配置 </summary>
public virtual DbSet<cof_director> cof_director { get; set; } public virtual DbSet<cof_director> cof_director { get; set; }
/// <summary> 工作量门诊药占比系数 </summary> /// <summary> 工作量门诊药占比系数 </summary>
......
//-----------------------------------------------------------------------
// <copyright file=" cof_depttype.cs">
// * FileName: 科室类型.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// 科室类型
/// </summary>
[Table("cof_depttype")]
public class cof_depttype
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Charge { get; set; }
/// <summary>
/// 可是分类
/// </summary>
public string ChargeType { get; set; }
}
}
...@@ -205,5 +205,15 @@ public class im_accountbasic ...@@ -205,5 +205,15 @@ public class im_accountbasic
/// 工作量倾斜系数 /// 工作量倾斜系数
/// </summary> /// </summary>
public Nullable<decimal> WorkSlopeFactor { get; set; } public Nullable<decimal> WorkSlopeFactor { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> UpdateDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> UpdateUser { get; set; }
} }
} }
...@@ -96,8 +96,14 @@ public class im_data ...@@ -96,8 +96,14 @@ public class im_data
/// </summary> /// </summary>
public string SignID { get; set; } public string SignID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> UpdateDate { get; set; } public Nullable<DateTime> UpdateDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> UpdateUser { get; set; } public Nullable<int> UpdateUser { get; set; }
} }
} }
...@@ -126,8 +126,14 @@ public class im_employee ...@@ -126,8 +126,14 @@ public class im_employee
/// </summary> /// </summary>
public Nullable<decimal> Grant { get; set; } public Nullable<decimal> Grant { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> UpdateDate { get; set; } public Nullable<DateTime> UpdateDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> UpdateUser { get; set; } public Nullable<int> UpdateUser { get; set; }
} }
} }
...@@ -131,8 +131,14 @@ public class im_employee_clinic ...@@ -131,8 +131,14 @@ public class im_employee_clinic
/// </summary> /// </summary>
public Nullable<decimal> Grant { get; set; } public Nullable<decimal> Grant { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> UpdateDate { get; set; } public Nullable<DateTime> UpdateDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> UpdateUser { get; set; } public Nullable<int> UpdateUser { get; set; }
} }
} }
...@@ -76,8 +76,14 @@ public class im_header ...@@ -76,8 +76,14 @@ public class im_header
/// </summary> /// </summary>
public Nullable<int> IsTotal { get; set; } public Nullable<int> IsTotal { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> UpdateDate { get; set; } public Nullable<DateTime> UpdateDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> UpdateUser { get; set; } public Nullable<int> UpdateUser { get; set; }
} }
} }
...@@ -81,8 +81,14 @@ public class im_specialunit ...@@ -81,8 +81,14 @@ public class im_specialunit
/// </summary> /// </summary>
public Nullable<decimal> Adjust { get; set; } public Nullable<decimal> Adjust { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> UpdateDate { get; set; } public Nullable<DateTime> UpdateDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> UpdateUser { get; set; } public Nullable<int> UpdateUser { get; set; }
} }
} }
//-----------------------------------------------------------------------
// <copyright file=" cof_depttype.cs">
// * FileName: cof_depttype.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// cof_depttype Repository
/// </summary>
public partial class PerforCofdepttypeRepository : PerforRepository<cof_depttype>
{
public PerforCofdepttypeRepository(PerformanceDbContext context) : base(context)
{
}
}
}
...@@ -26,6 +26,7 @@ public class ConfigService : IAutoInjection ...@@ -26,6 +26,7 @@ public class ConfigService : IAutoInjection
private PerforHospitalRepository perforHospitalRepository; private PerforHospitalRepository perforHospitalRepository;
private PerforPersheetRepository perforPersheetRepository; private PerforPersheetRepository perforPersheetRepository;
private PerforImheaderRepository perforImheaderRepository; private PerforImheaderRepository perforImheaderRepository;
private PerforCofdepttypeRepository perforCofdepttypeRepository;
//private PerforLogdbugRepository logdbug; //private PerforLogdbugRepository logdbug;
private readonly LogManageService logManageService; private readonly LogManageService logManageService;
public ConfigService(PerforCofdirectorRepository cofdirectorRepository, public ConfigService(PerforCofdirectorRepository cofdirectorRepository,
...@@ -40,6 +41,7 @@ public class ConfigService : IAutoInjection ...@@ -40,6 +41,7 @@ public class ConfigService : IAutoInjection
PerforCofworkitemRepository workitemRepository, PerforCofworkitemRepository workitemRepository,
PerforPersheetRepository perforPersheetRepository, PerforPersheetRepository perforPersheetRepository,
PerforImheaderRepository perforImheaderRepository, PerforImheaderRepository perforImheaderRepository,
PerforCofdepttypeRepository perforCofdepttypeRepository,
//PerforLogdbugRepository logdbug //PerforLogdbugRepository logdbug
LogManageService logManageService) LogManageService logManageService)
{ {
...@@ -55,6 +57,7 @@ public class ConfigService : IAutoInjection ...@@ -55,6 +57,7 @@ public class ConfigService : IAutoInjection
this.perforHospitalRepository = perforHospitalRepository; this.perforHospitalRepository = perforHospitalRepository;
this.perforPersheetRepository = perforPersheetRepository; this.perforPersheetRepository = perforPersheetRepository;
this.perforImheaderRepository = perforImheaderRepository; this.perforImheaderRepository = perforImheaderRepository;
this.perforCofdepttypeRepository = perforCofdepttypeRepository;
//this.logdbug = logdbug; //this.logdbug = logdbug;
this.logManageService = logManageService; this.logManageService = logManageService;
} }
...@@ -416,6 +419,69 @@ public bool WorkItemkDelete(WorkItemRequest request) ...@@ -416,6 +419,69 @@ public bool WorkItemkDelete(WorkItemRequest request)
} }
#endregion #endregion
#region cof_depttype 科室别配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
/// <returns></returns>
public List<cof_depttype> GetDepttypeList(int allotId)
{
var list = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allotId);
return list;
}
/// <summary>
/// 添加数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public cof_depttype DepttypeInsert(DrugpropRequest request)
{
var entity = new cof_depttype
{
AllotID = request.AllotID,
Charge = request.Charge,
ChargeType = request.ChargeType
};
if (!perforCofdepttypeRepository.Add(entity))
throw new PerformanceException("保存失败");
return entity;
}
/// <summary>
/// 更新数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public cof_depttype DepttypeUpdate(DrugpropRequest request)
{
var entity = perforCofdepttypeRepository.GetEntity(t => t.ID == request.ID);
if (null == entity)
throw new PerformanceException($"ID不存在 :{request.ID}");
entity.Charge = request.Charge;
entity.ChargeType = request.ChargeType;
if (!perforCofdepttypeRepository.Update(entity))
throw new PerformanceException("保存失败");
return entity;
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool DepttypeDelete(DrugpropRequest request)
{
var entity = perforCofdepttypeRepository.GetEntity(t => t.ID == request.ID);
if (null == entity)
throw new PerformanceException($"ID不存在 :{request.ID}");
return perforCofdepttypeRepository.Remove(entity);
}
#endregion
#region Copy #region Copy
/// <summary> /// <summary>
/// 复制报表基础配置 /// 复制报表基础配置
...@@ -480,6 +546,15 @@ public void Copy(per_allot allot) ...@@ -480,6 +546,15 @@ public void Copy(per_allot allot)
_drugtypeRepository.AddRange(newAgains.ToArray()); _drugtypeRepository.AddRange(newAgains.ToArray());
} }
var cofDepttype = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allot.ID);
if (cofDepttype == null || cofDepttype.Count == 0)
{
var depttype = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allotId)
?? perforCofdepttypeRepository.GetEntities(t => t.AllotID == -1);
var newAgains = depttype.Select(t => new cof_depttype { AllotID = allot.ID, Charge = t.Charge, ChargeType = t.ChargeType });
perforCofdepttypeRepository.AddRange(newAgains.ToArray());
}
var workItem = _workitemRepository.GetEntities(t => t.AllotID == allot.ID); var workItem = _workitemRepository.GetEntities(t => t.AllotID == allot.ID);
if (hospital != null && hospital?.IsOpenDrugprop == 1 && (workItem == null || workItem.Count == 0)) if (hospital != null && hospital?.IsOpenDrugprop == 1 && (workItem == null || workItem.Count == 0))
{ {
......
...@@ -441,7 +441,7 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul ...@@ -441,7 +441,7 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul
if (workitem == null || !workitem.Any(t => t.Id > 0)) if (workitem == null || !workitem.Any(t => t.Id > 0))
return; return;
var deptHeader = perforAgworkloadtypeRepository.GetEntities(t => request.HospitalId == t.HospitalId); var deptHeader = perforAgworkloadtypeRepository.GetEntities(t => new List<int> { request.HospitalId, 0 }.Contains(t.HospitalId));
if (deptHeader == null || !deptHeader.Any()) if (deptHeader == null || !deptHeader.Any())
return; return;
...@@ -489,6 +489,14 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul ...@@ -489,6 +489,14 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul
} }
} }
var defauleHeader = deptHeader.Where(t => t.HospitalId == 0).ToList();
defauleHeader.Add(new ag_workload_type { Id = 2, TypeName = "工作量分配绩效金额" });
foreach (var item in defauleHeader)
{
result.HeadItems.Where(t => t.FiledName == item.TypeName).ToList()?.ForEach(t => t.WorkType = item.Id);
result.BodyItems.Where(t => t.FiledName == item.TypeName).ToList()?.ForEach(t => t.WorkType = item.Id);
}
var rownumber = result.BodyItems.Any(t => t.RowNumber == -1) ? -1 : 0; var rownumber = result.BodyItems.Any(t => t.RowNumber == -1) ? -1 : 0;
foreach (var item in headerItems) foreach (var item in headerItems)
{ {
......
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