Commit c34a9b52 by gzq

护理部审核列表更新(查视图)

parent d80ba249
......@@ -4,6 +4,7 @@
using System.Linq;
using System.Threading.Tasks;
using Dapper;
using Google.Protobuf.WellKnownTypes;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using MySql.Data.MySqlClient;
......@@ -563,6 +564,32 @@ public IEnumerable<dynamic> QueryAttendanceDeptReportCompute(int allotId, string
}
}
public List<ag_secondallot> QueryNursingSecond(int allotId)
{
try
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
string sql = $@"select * from view_second_nursing where AllotID = @allotId";
DynamicParameters parameters = new DynamicParameters();
parameters.Add("@allotId", allotId);
var result = connection.Query<ag_secondallot>(sql, parameters, commandTimeout: 60 * 60);
var enums = UnitTypeUtil.GetUnitTypeFromEnum();
return result.Where(w => w.RealGiveFee.HasValue && w.RealGiveFee != 0)
.OrderBy(t => t.Status == 4 ? 2 : t.Status)
.ThenBy(t => enums.FirstOrDefault(f => f.Name == t.UnitType)?.Value)
.ThenBy(t => t.Department)
.ToList();
}
}
catch (Exception ex)
{
_logger.LogError($"SQL执行异常:{ex}");
throw;
}
}
}
}
......@@ -1675,10 +1675,12 @@ public List<ag_secondallot> NursingDeptlist(int allotId)
var allot = perallotRepository.GetEntity(t => t.ID == allotId);
if (allot == null)
throw new PerformanceException("所选绩效不存在!");
var types = new int[] { (int)UnitType.其他护理组, (int)UnitType.护理组 };
var accountUnit = resaccountRepository.GetEntities(t => t.AllotID == allotId && types.Contains(t.UnitType.Value));
var specialunit = resspecialunitRepository.GetEntities(t => t.AllotID == allot.ID);
return SecondList(allot, accountUnit, specialunit);
//var types = new int[] { (int)UnitType.其他护理组, (int)UnitType.护理组 };
//var accountUnit = resaccountRepository.GetEntities(t => t.AllotID == allotId && types.Contains(t.UnitType.Value));
//var specialunit = resspecialunitRepository.GetEntities(t => t.AllotID == allot.ID);
//return SecondList(allot, accountUnit, specialunit);
return _service.QueryNursingSecond(allot.ID);
}
/// <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