Commit f6a1f106 by lcx

二次绩效新模板添加字段,提交后排序

parent bed6a05a
......@@ -1175,7 +1175,7 @@
</member>
<member name="P:Performance.EntityModels.ag_secondallot.SubmitType">
<summary>
提交类型 1使用模板 2 其他类型数据
提交类型 1 使用模板 2 其他类型数据
</summary>
</member>
<member name="P:Performance.EntityModels.ag_secondallot.SubmitTime">
......@@ -1423,6 +1423,11 @@
</summary>
</member>
<member name="P:Performance.EntityModels.ag_workload_source.WorkTypeId">
<summary>
1、单项奖励 2、工作量占比 ..(自定义占比)
</summary>
</member>
<member name="T:Performance.EntityModels.ag_workload_type">
<summary>
......
......@@ -82,7 +82,7 @@ public class ag_secondallot
public Nullable<int> Status { get; set; }
/// <summary>
/// 提交类型 1使用模板 2 其他类型数据
/// 提交类型 1 使用模板 2 其他类型数据
/// </summary>
public Nullable<int> SubmitType { get; set; }
......
......@@ -55,5 +55,10 @@ public class ag_workload_source
///
/// </summary>
public Nullable<decimal> Value { get; set; }
/// <summary>
/// 1、单项奖励 2、工作量占比 ..(自定义占比)
/// </summary>
public Nullable<int> WorkTypeId { get; set; }
}
}
......@@ -133,7 +133,7 @@ public List<HeadItem> GetHeadItems(int hospitalId, int tempId, ag_secondallot se
var configHeaders = agworkloadRepository.GetEntities(w => w.HospitalId == hospitalId && w.Department == secondAllot.Department && w.UnitType == secondAllot.UnitType);
if (SecondAllotService.defaultValues != null && SecondAllotService.defaultValues.Any())
configHeaders = configHeaders.Where(w => !SecondAllotService.defaultValues.Select(t => t.Item1).Contains(w.ItemName)).ToList();
configHeaders = configHeaders?.Where(w => !SecondAllotService.defaultValues.Select(t => t.Item1).Contains(w.ItemName)).ToList();
// 初始化固定列
var headItems = Mapper.Map<List<HeadItem>>(fixedHeaders) ?? new List<HeadItem>();
......
......@@ -420,10 +420,14 @@ public dynamic GetWorkloadDict(int secondId)
private dynamic GetWorkloadDictAfterAudit(int secondId)
{
var bodysources = agbodysourceRepository.GetEntities(t => t.SecondId == secondId);
if (bodysources == null || !bodysources.Any()) return new string[] { };
var workloadsources = agworkloadsourceRepository.GetEntities(t => bodysources.Select(w => w.Id).Contains(t.BodyId));
if (workloadsources == null || !workloadsources.Any()) return new string[] { };
var dict = workloadsources.GroupBy(t => new { t.ItemId, t.ItemName, t.FactorValue }).Select(t => new
var dict = workloadsources.GroupBy(t => new { t.ItemId, t.ItemName, t.FactorValue, t.Sort, t.WorkTypeId, t.WorkloadId })
.OrderBy(t => t.Key.WorkTypeId).ThenBy(t => t.Key.Sort)
.Select(t => new
{
Title = t.Key.ItemId,
Value = t.Key.ItemName,
......@@ -553,7 +557,8 @@ private void SaveSecondAllotBodyData(int hospitalId, ag_secondallot second, dyna
ItemName = workload.ItemName,
FactorValue = workload.FactorValue,
Sort = workload.Sort,
Value = ConvertHelper.To<decimal>(dict[key])
Value = ConvertHelper.To<decimal>(dict[key]),
WorkTypeId = workload.WorkTypeId
});
}
}
......
......@@ -1656,7 +1656,10 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
return true;
var computes = new List<ag_compute>();
if (second.SubmitType == 1)
var (tempId, name) = GetUsingTempId(hospital.ID, second);
if (new int[] { (int)Temp.crosswise, (int)Temp.lengthways }.Contains(tempId))
{
var items = agfixatitemRepository.GetEntities(t => t.SecondId == request.SecondId);
if (items != null && items.Any())
......@@ -1686,7 +1689,7 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
}
}
}
else if (second.SubmitType == 2)
else if (tempId == (int)Temp.other)
{
var others = agothersourceRepository.GetEntities(t => t.SecondId == request.SecondId);
if (others != null && others.Any())
......@@ -1710,6 +1713,30 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
}
}
}
else
{
var bodys = agbodysourceRepository.GetEntities(t => t.SecondId == request.SecondId);
if (bodys != null && bodys.Any())
{
foreach (var item in bodys)
{
computes.Add(new ag_compute
{
AllotId = second.AllotId,
SecondId = second.Id,
UnitType = second.UnitType,
Department = second.Department,
WorkPost = item.Post,
JobNumber = item.WorkNumber,
PersonName = item.Name,
PerforSumFee = item.DistPerformance,
OthePerfor = item.OtherPerformance,
NightWorkPerfor = item.NightWorkPerformance,
RealGiveFee = item.RealAmount,
});
}
}
}
agcomputeRepository.AddRange(computes.ToArray());
}
......
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