个人绩效查询取消登录验证

parent 03339a8d
...@@ -560,14 +560,15 @@ public ApiResponse GetOwnerPerformance() ...@@ -560,14 +560,15 @@ public ApiResponse GetOwnerPerformance()
/// <summary> /// <summary>
/// H5查询个人绩效 /// H5查询个人绩效
/// </summary> /// </summary>
/// <param name="jobNumber">员工工号</param>
/// <param name="begin">开始月份:2021-03</param> /// <param name="begin">开始月份:2021-03</param>
/// <param name="end">结束月份:2021-04</param> /// <param name="end">结束月份:2021-04</param>
/// <returns></returns> /// <returns></returns>
[Route("owner/query/mobile")] [Route("owner/query/mobile")]
[HttpGet] [HttpGet]
public ApiResponse<List<OwnerMobilePerformanceDto>> GetOwnerMobilePerformance(string begin = "", string end = "") [AllowAnonymous]
public ApiResponse<List<OwnerMobilePerformanceDto>> GetOwnerMobilePerformance(string jobNumber = "", string begin = "", string end = "")
{ {
var userid = _claim.GetUserId();
var beginDate = begin.ToTryDateTime(); var beginDate = begin.ToTryDateTime();
var endDate = end.ToTryDateTime(); var endDate = end.ToTryDateTime();
...@@ -575,7 +576,7 @@ public ApiResponse<List<OwnerMobilePerformanceDto>> GetOwnerMobilePerformance(st ...@@ -575,7 +576,7 @@ public ApiResponse<List<OwnerMobilePerformanceDto>> GetOwnerMobilePerformance(st
throw new PerformanceException("您选择的时间范围无效"); throw new PerformanceException("您选择的时间范围无效");
endDate = endDate.AddMonths(1); endDate = endDate.AddMonths(1);
var dtos = _allotService.GetOwnerMobilePerformance(userid, beginDate, endDate); var dtos = _allotService.GetOwnerMobilePerformance(jobNumber, beginDate, endDate);
return new ApiResponse<List<OwnerMobilePerformanceDto>>(ResponseType.OK, dtos); return new ApiResponse<List<OwnerMobilePerformanceDto>>(ResponseType.OK, dtos);
} }
} }
......
...@@ -338,10 +338,11 @@ ...@@ -338,10 +338,11 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.AllotController.GetOwnerMobilePerformance(System.String,System.String)"> <member name="M:Performance.Api.Controllers.AllotController.GetOwnerMobilePerformance(System.String,System.String,System.String)">
<summary> <summary>
H5查询个人绩效 H5查询个人绩效
</summary> </summary>
<param name="jobNumber">员工工号</param>
<param name="begin">开始月份:2021-03</param> <param name="begin">开始月份:2021-03</param>
<param name="end">结束月份:2021-04</param> <param name="end">结束月份:2021-04</param>
<returns></returns> <returns></returns>
......
...@@ -8945,6 +8945,16 @@ ...@@ -8945,6 +8945,16 @@
费用 费用
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.view_other_amount.UnitType">
<summary>
核算单元组别
</summary>
</member>
<member name="P:Performance.EntityModels.view_other_amount.AccountingUnit">
<summary>
核算单元
</summary>
</member>
<member name="P:Performance.EntityModels.view_per_apr_amount.UnitType"> <member name="P:Performance.EntityModels.view_per_apr_amount.UnitType">
<summary> <summary>
核算单元组别 核算单元组别
......
...@@ -50,6 +50,13 @@ public class OwnerMobileItemDto ...@@ -50,6 +50,13 @@ public class OwnerMobileItemDto
} }
public class OwnerMobileItemDetailDto public class OwnerMobileItemDetailDto
{ {
public OwnerMobileItemDetailDto(string title, decimal amount, string date)
{
Title = title;
Amount = amount;
Date = date;
}
/// <summary> /// <summary>
/// 类型名称 /// 类型名称
/// </summary> /// </summary>
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
{ {
public class view_allot_sign_emp_finance public class view_allot_sign_emp_finance
{ {
public string HospitalID { get; set; } public int HospitalID { get; set; }
public string Year { get; set; } public int Year { get; set; }
public string Month { get; set; } public int Month { get; set; }
public string AllotId { get; set; } public int AllotId { get; set; }
public string JobNumber { get; set; } public string JobNumber { get; set; }
public string EmployeeName { get; set; } public string EmployeeName { get; set; }
public string JobTitle { get; set; } public string JobTitle { get; set; }
...@@ -29,12 +29,14 @@ public class view_allot_sign_emp_finance ...@@ -29,12 +29,14 @@ public class view_allot_sign_emp_finance
public class view_allot_sign_emp : view_allot_sign_emp_finance public class view_allot_sign_emp : view_allot_sign_emp_finance
{ {
public int Source { get; set; } public string Source { get; set; }
public int SecondId { get; set; } public int SecondId { get; set; }
public int States { get; set; } public int States { get; set; }
public string IsShowManage { get; set; } public string IsShowManage { get; set; }
public string Emp_UnitType { get; set; } public string Emp_UnitType { get; set; }
public string Emp_AccountingUnit { get; set; } public string Emp_AccountingUnit { get; set; }
public string Batch { get; set; } public string Batch { get; set; }
public string BatchDate { get; set; }
public string BankName { get; set; }
} }
} }
...@@ -2,6 +2,21 @@ ...@@ -2,6 +2,21 @@
namespace Performance.EntityModels namespace Performance.EntityModels
{ {
public class view_other_amount
{
public int AllotId { get; set; }
public string PersonnelNumber { get; set; }
/// <summary>
/// 核算单元组别
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
public string PerforType { get; set; }
public decimal Amount { get; set; }
}
public class view_per_apr_amount : per_apr_amount public class view_per_apr_amount : per_apr_amount
{ {
/// <summary> /// <summary>
......
...@@ -397,6 +397,34 @@ public List<view_allot_result> GetOwnerPerformance(List<int> hospitalId, string ...@@ -397,6 +397,34 @@ public List<view_allot_result> GetOwnerPerformance(List<int> hospitalId, string
return DapperQuery<view_allot_result>(sql, new { HospitalID = hospitalId, JobNumber = jobNumber })?.ToList(); return DapperQuery<view_allot_result>(sql, new { HospitalID = hospitalId, JobNumber = jobNumber })?.ToList();
} }
public List<view_allot_sign_emp> GetOwnerPerformance(string jobNumber)
{
string sql = "SELECT * FROM freeze_allot_sign_emp WHERE (States = 8 OR IFNULL(Batch,'') != '') AND JobNumber=@JobNumber";
return DapperQuery<view_allot_sign_emp>(sql, new { JobNumber = jobNumber })?.ToList();
}
/// <summary>
/// 个人绩效查询 医院其他绩效
/// </summary>
/// <param name="jobNumber"></param>
/// <returns></returns>
public List<view_other_amount> GetOwnerOtherAmount(string jobNumber)
{
string sql = "SELECT * FROM view_other_amount WHERE Status = 3 AND PersonnelNumber = @JobNumber";
return DapperQuery<view_other_amount>(sql, new { JobNumber = jobNumber })?.ToList();
}
/// <summary>
/// 个人绩效查询 不公示其他绩效
/// </summary>
/// <param name="jobNumber"></param>
/// <returns></returns>
public List<view_other_amount> GetOwnerOtherAmountHide(string jobNumber)
{
string sql = "SELECT * FROM view_other_amount_hide WHERE Status = 3 AND PersonnelNumber = @JobNumber";
return DapperQuery<view_other_amount>(sql, new { JobNumber = jobNumber })?.ToList();
}
public List<dynamic> QueryCompute(int allotId, string viewName) public List<dynamic> QueryCompute(int allotId, string viewName)
{ {
var sql = $@"SELECT * FROM {viewName} WHERE AllotId = @AllotId; "; var sql = $@"SELECT * FROM {viewName} WHERE AllotId = @AllotId; ";
......
...@@ -782,16 +782,14 @@ public List<OwnerPerformanceDto> GetOwnerPerformance(int userid) ...@@ -782,16 +782,14 @@ public List<OwnerPerformanceDto> GetOwnerPerformance(int userid)
/// <param name="beginDate"></param> /// <param name="beginDate"></param>
/// <param name="endDate"></param> /// <param name="endDate"></param>
/// <returns></returns> /// <returns></returns>
public List<OwnerMobilePerformanceDto> GetOwnerMobilePerformance(int userid, DateTime beginDate, DateTime endDate) public List<OwnerMobilePerformanceDto> GetOwnerMobilePerformance(string jobNumber, DateTime beginDate, DateTime endDate)
{ {
List<OwnerMobilePerformanceDto> dtos = new List<OwnerMobilePerformanceDto>(); List<OwnerMobilePerformanceDto> dtos = new List<OwnerMobilePerformanceDto>();
var datas = GetOwnerPerformance(userid); var datas = _reportRepository.GetOwnerPerformance(jobNumber) ?? new List<view_allot_sign_emp>();
var otherAmounts = _reportRepository.GetOwnerOtherAmount(jobNumber) ?? new List<view_other_amount>();
var otherAmountHides = _reportRepository.GetOwnerOtherAmountHide(jobNumber) ?? new List<view_other_amount>();
if (datas == null || datas.Count == 0) var filterDatas = datas.Where(w => (new DateTime(w.Year, w.Month, 1)) >= beginDate && (new DateTime(w.Year, w.Month, 1)) < endDate);
return dtos;
var filterDatas = datas
.Where(w => (new DateTime(w.Year, w.Month, 1)) >= beginDate && (new DateTime(w.Year, w.Month, 1)) < endDate);
var groupDatas = filterDatas.GroupBy(w => w.JobNumber); var groupDatas = filterDatas.GroupBy(w => w.JobNumber);
foreach (var item in groupDatas) foreach (var item in groupDatas)
...@@ -799,72 +797,55 @@ public List<OwnerMobilePerformanceDto> GetOwnerMobilePerformance(int userid, Dat ...@@ -799,72 +797,55 @@ public List<OwnerMobilePerformanceDto> GetOwnerMobilePerformance(int userid, Dat
var perforSumFee = new OwnerMobileItemDto var perforSumFee = new OwnerMobileItemDto
{ {
Title = "业绩绩效", Title = "业绩绩效",
Amount = item.Sum(w => w.PerforSumFee) ?? 0, Amount = item.Sum(w => w.PerforSumFee),
Details = item.SelectMany(w => w.Detail) Details = item
.Where(w => (w.PerforSumFee ?? 0) != 0 && !string.IsNullOrEmpty(w.IssueDate)) .Where(w => (w.PerforSumFee) != 0)
.Select(w => new OwnerMobileItemDetailDto .Select(w => new OwnerMobileItemDetailDto(w.AccountingUnit, w.PerforSumFee, w.BatchDate)).ToList()
{
Title = w.AccountingUnit,
Amount = w.PerforSumFee ?? 0,
Date = w.IssueDate,
}).ToList()
}; };
var perforManagementFee = new OwnerMobileItemDto var perforManagementFee = new OwnerMobileItemDto
{ {
Title = "管理绩效", Title = "管理绩效",
Amount = item.Sum(w => w.PerforManagementFee) ?? 0, Amount = item.Sum(w => w.PerforManagementFee),
Details = item.SelectMany(w => w.Detail) Details = item
.Where(w => (w.PerforManagementFee ?? 0) != 0 && !string.IsNullOrEmpty(w.IssueDate)) .Where(w => w.PerforManagementFee != 0)
.Select(w => new OwnerMobileItemDetailDto .Select(w => new OwnerMobileItemDetailDto(w.AccountingUnit, w.PerforManagementFee, w.BatchDate)).ToList()
{
Title = w.AccountingUnit,
Amount = w.PerforManagementFee ?? 0,
Date = w.IssueDate,
}).ToList()
}; };
var nightWorkPerfor = new OwnerMobileItemDto var nightWorkPerfor = new OwnerMobileItemDto
{ {
Title = "夜班绩效", Title = "夜班绩效",
Amount = item.Sum(w => w.NightWorkPerfor) ?? 0, Amount = item.Sum(w => w.NightWorkPerfor),
Details = item.SelectMany(w => w.Detail) Details = item
.Where(w => (w.NightWorkPerfor ?? 0) != 0 && !string.IsNullOrEmpty(w.IssueDate)) .Where(w => w.NightWorkPerfor != 0)
.Select(w => new OwnerMobileItemDetailDto .Select(w => new OwnerMobileItemDetailDto(w.AccountingUnit, w.NightWorkPerfor, w.BatchDate)).ToList()
{
Title = w.AccountingUnit,
Amount = w.NightWorkPerfor ?? 0,
Date = w.IssueDate,
}).ToList()
}; };
var otherPerfor = new OwnerMobileItemDto var otherPerfor = new OwnerMobileItemDto
{ {
Title = "医院其他绩效", Title = "医院其他绩效",
Amount = item.Sum(w => w.OtherPerfor) ?? 0, Amount = item.Sum(w => w.OtherPerfor),
Details = item.SelectMany(w => w.Detail) Details = new List<OwnerMobileItemDetailDto>()
.Where(w => (w.OtherPerfor ?? 0) != 0 && !string.IsNullOrEmpty(w.IssueDate))
.Select(w => new OwnerMobileItemDetailDto
{
Title = w.SourceItem,
Amount = w.OtherPerfor ?? 0,
Date = w.IssueDate,
}).ToList()
}; };
foreach (var p in item)
{
var qt = otherAmounts.Where(w => w.AllotId == p.AllotId).Select(w => new OwnerMobileItemDetailDto(w.PerforType, w.Amount, p.BatchDate));
if (qt.Any()) otherPerfor.Details.AddRange(qt);
}
var hideOtherPerfor = new OwnerMobileItemDto var hideOtherPerfor = new OwnerMobileItemDto
{ {
Title = "不公示其他绩效", Title = "不公示其他绩效",
Amount = item.Sum(w => w.HideOtherPerfor) ?? 0, Amount = item.Sum(w => w.HideOtherPerfor),
Details = item.SelectMany(w => w.Detail) Details = new List<OwnerMobileItemDetailDto>()
.Where(w => (w.HideOtherPerfor ?? 0) != 0 && !string.IsNullOrEmpty(w.IssueDate))
.Select(w => new OwnerMobileItemDetailDto
{
Title = w.SourceItem,
Amount = w.HideOtherPerfor ?? 0,
Date = w.IssueDate,
}).ToList()
}; };
foreach (var p in item)
{
var qt = otherAmountHides.Where(w => w.AllotId == p.AllotId).Select(w => new OwnerMobileItemDetailDto(w.PerforType, w.Amount, p.BatchDate));
if (qt.Any()) hideOtherPerfor.Details.AddRange(qt);
}
var reservedRatioFee = new OwnerMobileItemDto var reservedRatioFee = new OwnerMobileItemDto
{ {
Title = "预留绩效", Title = "预留绩效",
Amount = item.Sum(w => w.ReservedRatioFee) ?? 0, Amount = item.Sum(w => w.ReservedRatioFee),
Details = new List<OwnerMobileItemDetailDto>() Details = new List<OwnerMobileItemDetailDto>()
}; };
......
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