新增模板名称返回

parent 24774025
...@@ -15,6 +15,7 @@ public class SecondAllotResponse ...@@ -15,6 +15,7 @@ public class SecondAllotResponse
public class Detail public class Detail
{ {
public int TempId { get; set; } public int TempId { get; set; }
public string TempName { get; set; }
/// <summary> 是否归档 </summary> /// <summary> 是否归档 </summary>
public int IsArchive { get; set; } public int IsArchive { get; set; }
......
...@@ -23,9 +23,11 @@ public SecondAllotResponse GetSecondSavedData(int userId, int secondId, int empl ...@@ -23,9 +23,11 @@ public SecondAllotResponse GetSecondSavedData(int userId, int secondId, int empl
var allot = perallotRepository.GetEntity(t => t.ID == second.AllotId); var allot = perallotRepository.GetEntity(t => t.ID == second.AllotId);
if (allot == null) throw new PerformanceException("绩效记录不存在!"); if (allot == null) throw new PerformanceException("绩效记录不存在!");
var (tempId, name) = GetUsingTempId(allot.HospitalId, second);
var detail = new Detail() var detail = new Detail()
{ {
TempId = GetUsingTempId(allot.HospitalId, second), TempId = tempId,
TempName = name,
IsArchive = allot.States == 8 ? 1 : 0, IsArchive = allot.States == 8 ? 1 : 0,
States = allot.States, States = allot.States,
Status = second.Status ?? 1, Status = second.Status ?? 1,
...@@ -269,15 +271,18 @@ private JArray GetBodyResult(int hospitalId, ag_secondallot second, List<ag_body ...@@ -269,15 +271,18 @@ private JArray GetBodyResult(int hospitalId, ag_secondallot second, List<ag_body
/// <param name="hospitalId"></param> /// <param name="hospitalId"></param>
/// <param name="second"></param> /// <param name="second"></param>
/// <returns></returns> /// <returns></returns>
private int GetUsingTempId(int hospitalId, ag_secondallot second) private (int tempId, string name) GetUsingTempId(int hospitalId, ag_secondallot second)
{ {
int usingTempId = (int)Temp.other; int usingTempId = (int)Temp.other;
var usedTemp = agusetempRepository.GetEntity(t => t.HospitalId == hospitalId && t.Department == second.Department && t.UnitType == second.UnitType); var usedTemp = agusetempRepository.GetEntity(t => t.HospitalId == hospitalId && t.Department == second.Department && t.UnitType == second.UnitType);
if (usedTemp == null) return usingTempId; if (usedTemp != null)
{
if (new int[] { 2, 3 }.Contains(second.Status ?? 1)) if (new int[] { 2, 3 }.Contains(second.Status ?? 1))
usingTempId = (second.UseTempId ?? 0) == 0 ? (int)Temp.other : second.UseTempId.Value; usingTempId = (second.UseTempId ?? 0) == 0 ? (int)Temp.other : second.UseTempId.Value;
return usingTempId; }
var temp = agtempRepository.GetEntity(t => t.Id == usingTempId);
return (usingTempId, temp?.TempName);
} }
/// <summary> /// <summary>
......
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