Commit 8c41b20b by lcx

科室分类

parent 34d80dd9
......@@ -26,6 +26,7 @@ public class ConfigService : IAutoInjection
private PerforHospitalRepository perforHospitalRepository;
private PerforPersheetRepository perforPersheetRepository;
private PerforImheaderRepository perforImheaderRepository;
private PerforCofdepttypeRepository perforCofdepttypeRepository;
//private PerforLogdbugRepository logdbug;
private readonly LogManageService logManageService;
public ConfigService(PerforCofdirectorRepository cofdirectorRepository,
......@@ -40,6 +41,7 @@ public class ConfigService : IAutoInjection
PerforCofworkitemRepository workitemRepository,
PerforPersheetRepository perforPersheetRepository,
PerforImheaderRepository perforImheaderRepository,
PerforCofdepttypeRepository perforCofdepttypeRepository,
//PerforLogdbugRepository logdbug
LogManageService logManageService)
{
......@@ -55,6 +57,7 @@ public class ConfigService : IAutoInjection
this.perforHospitalRepository = perforHospitalRepository;
this.perforPersheetRepository = perforPersheetRepository;
this.perforImheaderRepository = perforImheaderRepository;
this.perforCofdepttypeRepository = perforCofdepttypeRepository;
//this.logdbug = logdbug;
this.logManageService = logManageService;
}
......@@ -416,6 +419,69 @@ public bool WorkItemkDelete(WorkItemRequest request)
}
#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
/// <summary>
/// 复制报表基础配置
......@@ -480,6 +546,15 @@ public void Copy(per_allot allot)
_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);
if (hospital != null && hospital?.IsOpenDrugprop == 1 && (workItem == null || workItem.Count == 0))
{
......
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