上线前 整理代码

This commit is contained in:
2022-06-01 10:01:57 +08:00
parent 7ace793235
commit bd44ac3b2c
20 changed files with 183 additions and 765 deletions
@@ -3,7 +3,6 @@ using IRaCIS.Application.Interfaces;
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Contracts.Pay;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure.ExpressionExtend;
using System.Linq.Expressions;
using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Domain.Models;
@@ -117,6 +117,8 @@ namespace IRaCIS.Application.Contracts.Pay
public string FirstName { get; set; } = String.Empty;
public string LastName { get; set; } = String.Empty;
public string FullName { get; set; } = String.Empty;
public decimal AdjustmentUSD { get; set; }
public decimal AdjustmentCNY { get; set; }
public decimal PaymentUSD { get; set; }
@@ -1,14 +1,11 @@
using IRaCIS.Core.Infrastructure.ExpressionExtend;
using IRaCIS.Application.Interfaces;
using IRaCIS.Application.Interfaces;
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Contracts.Pay;
using IRaCIS.Core.Domain.Share;
using System.Linq.Expressions;
using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Mvc;
using Panda.DynamicWebApi.Attributes;
using System.Linq.Dynamic.Core;
namespace IRaCIS.Application.Services
{
@@ -133,12 +130,17 @@ namespace IRaCIS.Application.Services
BankName = payInfo.BankName
};
var propName = string.IsNullOrWhiteSpace(queryParam.SortField) ? "Code" : queryParam.SortField;
costStatisticsQueryable = queryParam.Asc ? costStatisticsQueryable.OrderBy(propName).ThenBy(u => u.Code)
: costStatisticsQueryable.OrderByDescending(propName).ThenBy(u => u.Code);
var count = costStatisticsQueryable.Count();
costStatisticsQueryable = costStatisticsQueryable.Skip((queryParam.PageIndex - 1) * queryParam.PageSize).Take(queryParam.PageSize);
var costStatisticsList = await costStatisticsQueryable.ToListAsync();
return await costStatisticsQueryable.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrWhiteSpace(queryParam.SortField) ? "Code" : queryParam.SortField, queryParam.Asc);
//var propName = string.IsNullOrWhiteSpace(queryParam.SortField) ? "Code" : queryParam.SortField;
//costStatisticsQueryable = queryParam.Asc ? costStatisticsQueryable.OrderBy(propName).ThenBy(u => u.Code)
// : costStatisticsQueryable.OrderByDescending(propName).ThenBy(u => u.Code);
//var count = costStatisticsQueryable.Count();
//costStatisticsQueryable = costStatisticsQueryable.Skip((queryParam.PageIndex - 1) * queryParam.PageSize).Take(queryParam.PageSize);
//var costStatisticsList = await costStatisticsQueryable.ToListAsync();
//return new PageOutput<PaymentModel>(queryParam.PageIndex, queryParam.PageSize, count, costStatisticsList);
#region
@@ -167,7 +169,6 @@ namespace IRaCIS.Application.Services
#endregion
return new PageOutput<PaymentModel>(queryParam.PageIndex, queryParam.PageSize, count, costStatisticsList);
}
/// <summary>
@@ -405,6 +406,7 @@ namespace IRaCIS.Application.Services
ChineseName = doctor.ChineseName,
FirstName = doctor.FirstName,
LastName = doctor.LastName,
FullName= doctor.FullName,
ReviewerCode = doctor.ReviewerCode,
PaymentUSD = monthlyPay.PaymentUSD,
PaymentCNY = monthlyPay.PaymentCNY,
@@ -413,17 +415,20 @@ namespace IRaCIS.Application.Services
TotalCNY = monthlyPay.AdjustmentCNY + monthlyPay.PaymentCNY,
TotalUSD = monthlyPay.AdjustmentUSD + monthlyPay.PaymentUSD
};
var propName = queryParam.SortField == string.Empty ? "ReviewerCode" : queryParam.SortField;
query = queryParam.Asc ? query.OrderBy(propName).ThenBy(u => u.ReviewerCode) : query.OrderByDescending(propName).ThenBy(u => u.ReviewerCode);
if (propName == "FirstName" || propName == "LastName")
{
query = queryParam.Asc ? query.OrderBy(t => t.LastName).ThenBy(t => t.FirstName)
: query.OrderByDescending(t => t.LastName).ThenBy(t => t.FirstName);
}
var count = await query.CountAsync();
query = query.Skip((queryParam.PageIndex - 1) * queryParam.PageSize).Take(queryParam.PageSize);
var list = await query.ToListAsync();
return new PageOutput<MonthlyPaymentDTO>(queryParam.PageIndex, queryParam.PageSize, count, list);
return await query.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize, string.IsNullOrWhiteSpace(queryParam.SortField) ? "ReviewerCode" : queryParam.SortField, queryParam.Asc);
//var propName = queryParam.SortField == string.Empty ? "ReviewerCode" : queryParam.SortField;
//query = queryParam.Asc ? query.OrderBy(propName).ThenBy(u => u.ReviewerCode) : query.OrderByDescending(propName).ThenBy(u => u.ReviewerCode);
//if (propName == "FirstName" || propName == "LastName")
//{
// query = queryParam.Asc ? query.OrderBy(t => t.LastName).ThenBy(t => t.FirstName)
// : query.OrderByDescending(t => t.LastName).ThenBy(t => t.FirstName);
//}
//var count = await query.CountAsync();
//query = query.Skip((queryParam.PageIndex - 1) * queryParam.PageSize).Take(queryParam.PageSize);
//var list = await query.ToListAsync();
//return new PageOutput<MonthlyPaymentDTO>(queryParam.PageIndex, queryParam.PageSize, count, list);
}
@@ -833,13 +838,13 @@ namespace IRaCIS.Application.Services
//非详细 只用单字段排序
if (queryParam.StatType != 0)
{
query = queryParam.Asc ? query.OrderBy(propName) : query.OrderByDescending(propName);
query = queryParam.Asc ? query.OrderBy(propName) : query.OrderBy(propName + " desc");
}
//详情 多字段排序
if (queryParam.StatType == 0)
{
query = queryParam.Asc ? query.OrderBy(propName).ThenBy(t => t.TrialId).ThenBy(t => t.YearMonth).ThenBy(t => t.ReviewerCode) :
query.OrderByDescending(propName).ThenBy(t => t.TrialId).ThenBy(t => t.YearMonth).ThenBy(t => t.ReviewerCode)
query.OrderBy(propName + " desc").ThenBy(t => t.TrialId).ThenBy(t => t.YearMonth).ThenBy(t => t.ReviewerCode)
;
}
@@ -1,5 +1,4 @@
using AutoMapper;
using IRaCIS.Core.Infrastructure.ExpressionExtend;
using IRaCIS.Application.Interfaces;
using IRaCIS.Application.Contracts;
using System.Linq.Expressions;
@@ -1,5 +1,4 @@
using AutoMapper;
using IRaCIS.Core.Infrastructure.ExpressionExtend;
using IRaCIS.Application.Interfaces;
using IRaCIS.Application.Contracts;
using System.Linq.Expressions;
@@ -1,6 +1,5 @@
using AutoMapper;
using AutoMapper.QueryableExtensions;
using IRaCIS.Core.Infrastructure.ExpressionExtend;
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore;