限定科室必须提交后才能打印

parent fafd7b7d
...@@ -1363,7 +1363,7 @@ public bool WorkloadAdd(WorkloadRequest request) ...@@ -1363,7 +1363,7 @@ public bool WorkloadAdd(WorkloadRequest request)
Expression<Func<ag_workload, bool>> exp = (t) => t.HospitalId == request.HospitalId && t.Department == request.Department && t.UnitType == request.UnitType; Expression<Func<ag_workload, bool>> exp = (t) => t.HospitalId == request.HospitalId && t.Department == request.Department && t.UnitType == request.UnitType;
if (request.IsSingleAwards) if (request.IsSingleAwards)
{ {
exp = exp.And(t => t.ItemId.StartsWith(AgWorkloadType.SingleAwards.ToString())); exp = exp.And(t => t.ItemId.StartsWith(AgWorkloadType.SingleAwards.ToString()));
} }
else else
{ {
...@@ -2128,12 +2128,18 @@ public dynamic Print(int secondId) ...@@ -2128,12 +2128,18 @@ public dynamic Print(int secondId)
var second = agsecondallotRepository.GetEntity(t => t.Id == secondId); var second = agsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second == null) return new List<SecPrintResponse>(); if (second == null) return new List<SecPrintResponse>();
//var computes = agcomputeRepository.GetEntities(t => t.SecondId == secondId); var status = new int[] { (int)SecondAllotStatus.WaitReview, (int)SecondAllotStatus.PassAudit };
//if (computes == null || !computes.Any()) if (!second.Status.HasValue || !status.Contains(second.Status.Value))
// return new List<SecPrintResponse>(); throw new PerformanceException("当前科室分配结果未提交,无法打印!");
if (!second.UseTempId.HasValue)
throw new PerformanceException("当前科室分配模板信息错误!");
var useTempId = second.UseTempId.Value;
List<SecPrintResponse> result = new List<SecPrintResponse>(); List<SecPrintResponse> result = new List<SecPrintResponse>();
SecPrintHeaderResponse header = new SecPrintHeaderResponse(); SecPrintHeaderResponse header = new SecPrintHeaderResponse();
if (second.UseTempId.HasValue && second.UseTempId == 6) if (useTempId == 6)
{ {
var data = agothersourceRepository.GetEntities(t => t.SecondId == secondId); var data = agothersourceRepository.GetEntities(t => t.SecondId == secondId);
if (data == null || !data.Any()) return new List<SecPrintResponse>(); if (data == null || !data.Any()) return new List<SecPrintResponse>();
...@@ -2145,7 +2151,7 @@ public dynamic Print(int secondId) ...@@ -2145,7 +2151,7 @@ public dynamic Print(int secondId)
header.NightShiftWorkPerforTotal = result.Sum(t => t.NightWorkPerformance ?? 0); header.NightShiftWorkPerforTotal = result.Sum(t => t.NightWorkPerformance ?? 0);
header.TotalPerformance = result.Sum(t => t.DistPerformance ?? 0); header.TotalPerformance = result.Sum(t => t.DistPerformance ?? 0);
} }
else if (second.UseTempId.HasValue && (new int[] { 9, 10 }).Contains(second.UseTempId.Value)) else if ((new int[] { 9, 10 }).Contains(useTempId))
{ {
var data = agbodysourceRepository.GetEntities(t => t.SecondId == secondId); var data = agbodysourceRepository.GetEntities(t => t.SecondId == secondId);
if (data == null || !data.Any()) return new List<SecPrintResponse>(); if (data == null || !data.Any()) return new List<SecPrintResponse>();
...@@ -2173,7 +2179,7 @@ public dynamic Print(int secondId) ...@@ -2173,7 +2179,7 @@ public dynamic Print(int secondId)
header = Mapper.Map<SecPrintHeaderResponse>(headerdata); header = Mapper.Map<SecPrintHeaderResponse>(headerdata);
//header.HosOtherPerformance = result.Sum(t => t.OtherPerformance ?? 0); //header.HosOtherPerformance = result.Sum(t => t.OtherPerformance ?? 0);
} }
else if (second.UseTempId.HasValue && (new int[] { 7, 8 }).Contains(second.UseTempId.Value)) else if ((new int[] { 7, 8 }).Contains(useTempId))
{ {
var itemname = new List<string> { "人员工号", "姓名", "职称", "职称绩效", "工作量绩效工资", "单项奖励小计", "可分配绩效", "医院其他绩效", "夜班工作量绩效" }; var itemname = new List<string> { "人员工号", "姓名", "职称", "职称绩效", "工作量绩效工资", "单项奖励小计", "可分配绩效", "医院其他绩效", "夜班工作量绩效" };
var fixaitems = agfixatitemRepository.GetEntities(t => t.SecondId == secondId && itemname.Contains(t.ItemName)); var fixaitems = agfixatitemRepository.GetEntities(t => t.SecondId == secondId && itemname.Contains(t.ItemName));
......
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