Commit 5121d1fc by lcx

bug修复

parent 9c8dd029
......@@ -9,6 +9,7 @@
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Infrastructure.Models;
using Performance.Services;
namespace Performance.Api.Controllers
......@@ -36,7 +37,8 @@ public PersonController(PersonService personService, ClaimService claimService)
[HttpPost]
public ApiResponse GetPersons([FromRoute] int allotId, [FromBody] PersonParamsRequest request)
{
var list = personService.GetPersons(allotId, claimService.GetUserId(), request);
var list = personService.GetPersons(allotId, claimService.GetUserId(), request)
?? new PageList<per_employee>(new List<per_employee>(), 0, request.PageNumber, request.PageSize);
return new ApiResponse(ResponseType.OK, new
{
list.CurrentPage,
......
......@@ -18,7 +18,7 @@ public partial class PerforPeremployeeRepository : PerforRepository<per_employee
{
public new PageList<per_employee> GetEntitiesForPaging(int pageNumber, int pageSize, Expression<Func<per_employee, bool>> exp)
{
IQueryable<per_employee> queryableAuthors = context.Set<per_employee>().Where(exp);
IQueryable<per_employee> queryableAuthors = context.Set<per_employee>().Where(exp).OrderBy(w => w.IsVerify).ThenBy(t => t.Id);
return PageList<per_employee>.Create(queryableAuthors, pageNumber, pageSize);
}
......
......@@ -213,11 +213,7 @@ public PageList<per_employee> GetPersons(int allotId, int userId, PersonParamsRe
var result = new List<per_employee>();
var list = peremployeeRepository.GetEntitiesForPaging(request.PageNumber, request.PageSize, exp);
if (list != null && list.Any())
result = list.OrderBy(w => w.IsVerify).ThenBy(t => t.Id).ToList();
return new PageList<per_employee>(result, list?.TotalCount ?? 0, request.PageNumber, request.PageSize);
return peremployeeRepository.GetEntitiesForPaging(request.PageNumber, request.PageSize, exp);
}
/// <summary>
......
......@@ -1590,7 +1590,7 @@ bool VerifySubmissioAmount(decimal? submitDataAmount, decimal? realGiveFee)
if (data == null || !data.Any())
throw new PerformanceException("提交时未检测到数据!");
var total = data.Sum(t => t.DistPerformance ?? 0 + t.NightWorkPerformance ?? 0); // 其他模板 = 可分配绩效 + 夜班绩效
var total = data.Sum(t => (t.DistPerformance ?? 0) + (t.NightWorkPerformance ?? 0)); // 其他模板 = 可分配绩效 + 夜班绩效
if (!VerifySubmissioAmount(total, second.RealGiveFee))
throw new PerformanceException($"总金额与考核后金额不一致!可分配金额:{second.RealGiveFee},提交金额:{total}");
}
......@@ -1611,7 +1611,7 @@ bool VerifySubmissioAmount(decimal? submitDataAmount, decimal? realGiveFee)
if (data == null || !data.Any())
throw new PerformanceException("提交时未检测到数据!");
var total = data.Sum(t => t.DistPerformance ?? 0 + t.NightWorkPerformance ?? 0);
var total = data.Sum(t => (t.DistPerformance ?? 0) + (t.NightWorkPerformance ?? 0));
if (!VerifySubmissioAmount(total, second.RealGiveFee))
throw new PerformanceException($"总金额与考核后金额不一致!可分配金额:{second.RealGiveFee},提交金额:{total}");
}
......
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