实发绩效比对

parent 5c90bfab
...@@ -723,7 +723,6 @@ public ApiResponse AprHideOverview(int allotId) ...@@ -723,7 +723,6 @@ public ApiResponse AprHideOverview(int allotId)
/// <summary> /// <summary>
/// 实发绩效比对 /// 实发绩效比对
/// </summary> /// </summary>
/// <param name="allotId"></param>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[Route("getComparison")] [Route("getComparison")]
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"AppConnection": { "AppConnection": {
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", //"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=192.168.18.166;database=db_test_zhangye;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", "PerformanceConnectionString": "server=192.168.18.166;database=db_performance_screen;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;", "HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;",
"RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2" "RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2"
}, },
......
...@@ -1190,7 +1190,6 @@ ...@@ -1190,7 +1190,6 @@
<summary> <summary>
实发绩效比对 实发绩效比对
</summary> </summary>
<param name="allotId"></param>
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
......
...@@ -72,5 +72,6 @@ public class PerDataSpecialUnit : IPerData ...@@ -72,5 +72,6 @@ public class PerDataSpecialUnit : IPerData
/// 管理绩效发放系数 /// 管理绩效发放系数
/// </summary> /// </summary>
public Nullable<decimal> Management { get; set; } public Nullable<decimal> Management { get; set; }
public decimal? RealGiveFee { get; set; }
} }
} }
...@@ -90,5 +90,6 @@ public class im_specialunit ...@@ -90,5 +90,6 @@ public class im_specialunit
/// ///
/// </summary> /// </summary>
public Nullable<int> UpdateUser { get; set; } public Nullable<int> UpdateUser { get; set; }
public Nullable<decimal> RealGiveFee { get; set; }
} }
} }
...@@ -29,28 +29,89 @@ public new PageList<per_employee> GetEntitiesForPaging(int pageNumber, int pageS ...@@ -29,28 +29,89 @@ public new PageList<per_employee> GetEntitiesForPaging(int pageNumber, int pageS
} }
public Comparison GetComparison(ComparisonPagingRequest request) //public Comparison GetComparison(ComparisonPagingRequest request)
{ //{
var search = ""; // var search = "";
if (string.IsNullOrEmpty(request.SearchQuery)) // if (string.IsNullOrEmpty(request.SearchQuery))
search = " 1=1 "; // search = " 1=1 ";
else // else
{ // {
if (request.ViewName == "view_check_dept") // if (request.ViewName == "view_check_dept")
search = $" ( AccountingUnit like '%{request.SearchQuery}%' )"; // search = $" ( AccountingUnit like '%{request.SearchQuery}%' )";
else // else
search = $" ( AccountingUnit like '%{request.SearchQuery}%' or JobNumber like '%{request.SearchQuery}%' or EmployeeName like '%{request.SearchQuery}%') "; // search = $" ( AccountingUnit like '%{request.SearchQuery}%' or JobNumber like '%{request.SearchQuery}%' or EmployeeName like '%{request.SearchQuery}%') ";
} // }
// var result = new Comparison();
// var sql = $@"SELECT COUNT(*) FROM {request.ViewName} WHERE AllotId = @AllotId and {search}";
// result.TotalCount = DapperQuery<int>(sql, new { request.AllotId })?.FirstOrDefault() ?? 0;
var result = new Comparison(); // sql = $@"SELECT * FROM {request.ViewName} WHERE AllotId = @AllotId and {search} ORDER BY HospitalId,Year,Month,ABS(DIFF) DESC LIMIT {(request.PageIndex - 1) * request.PageSize},{request.PageSize}; ";
var sql = $@"SELECT COUNT(*) FROM {request.ViewName} WHERE AllotId = @AllotId and {search}";
result.TotalCount = DapperQuery<int>(sql, new { request.AllotId })?.FirstOrDefault() ?? 0;
sql = $@"SELECT * FROM {request.ViewName} WHERE AllotId = @AllotId and {search} ORDER BY HospitalId,Year,Month,ABS(DIFF) DESC LIMIT {(request.PageIndex - 1) * request.PageSize},{request.PageSize}; "; // result.Datas = DapperQuery<view_check_emp>(sql, new { request.AllotId })?.ToList();
// return result;
//}
result.Datas = DapperQuery<view_check_emp>(sql, new { request.AllotId })?.ToList(); /// <summary>
return result; /// 人员实发绩效比对
/// </summary>
/// <param name="allotId"></param>
/// <param name="searchQuery"></param>
/// <returns></returns>
public Comparison CheckEmployeeRealGiveFeeDiff(int allotId, string searchQuery)
{
var queryData = @"
SELECT *,IFNULL(RealGiveFeeExecl,0) - IFNULL(RealGiveFeeCompute,0) AS Diff FROM (
SELECT * FROM view_check_emp_clinic WHERE AllotId = @allotId UNION ALL
SELECT * FROM view_check_emp_employee WHERE AllotId = @allotId UNION ALL
SELECT * FROM view_check_emp_logistics WHERE AllotId = @allotId
) TAB
WHERE if(@searchQuery='','',AccountingUnit) LIKE @parm OR if(@searchQuery='','',JobNumber) LIKE @parm OR if(@searchQuery='','',EmployeeName) LIKE @parm
ORDER BY HospitalId,Year,Month,ABS(DIFF) DESC
";
var queryCount = @"
SELECT count(0) FROM (
SELECT * FROM view_check_emp_clinic WHERE AllotId = @allotId UNION ALL
SELECT * FROM view_check_emp_employee WHERE AllotId = @allotId UNION ALL
SELECT * FROM view_check_emp_logistics WHERE AllotId = @allotId
) TAB
WHERE if(@searchQuery='','',AccountingUnit) LIKE @parm OR if(@searchQuery='','',JobNumber) LIKE @parm OR if(@searchQuery='','',EmployeeName) LIKE @parm
";
return new Comparison()
{
Datas = DapperQuery<view_check_emp>(queryData, new { allotId, searchQuery, parm = $"%{searchQuery}%" })?.ToList() ?? new List<view_check_emp>(),
TotalCount = DapperQuery<int>(queryCount, new { allotId, searchQuery, parm = $"%{searchQuery}%" })?.FirstOrDefault() ?? 0,
};
}
/// <summary>
/// 科室实发绩效比对
/// </summary>
public Comparison CheckAccountingUnitRealGiveFeeDiff(int allotId, string searchQuery)
{
var queryData = @"
SELECT *,IFNULL(RealGiveFeeExecl,0) - IFNULL(RealGiveFeeCompute,0) AS Diff FROM (
SELECT * FROM view_check_dept_account WHERE AllotId = @allotId UNION ALL
SELECT * FROM view_check_dept_specialunit WHERE AllotId = @allotId
) TAB
WHERE if(@searchQuery='','',AccountingUnit) LIKE @parm
ORDER BY HospitalId,Year,Month,ABS(DIFF) DESC
";
var queryCount = @"
SELECT count(0) FROM (
SELECT * FROM view_check_dept_account WHERE AllotId = @allotId UNION ALL
SELECT * FROM view_check_dept_specialunit WHERE AllotId = @allotId
) TAB
WHERE if(@searchQuery='','',AccountingUnit) LIKE @parm
";
return new Comparison()
{
Datas = DapperQuery<view_check_emp>(queryData, new { allotId, searchQuery, parm = $"%{searchQuery}%" })?.ToList() ?? new List<view_check_emp>(),
TotalCount = DapperQuery<int>(queryCount, new { allotId, searchQuery, parm = $"%{searchQuery}%" })?.FirstOrDefault() ?? 0,
};
} }
} }
......
...@@ -1102,12 +1102,22 @@ public List<TitleValue> GetPerforTypeDictHide(int allotId) ...@@ -1102,12 +1102,22 @@ public List<TitleValue> GetPerforTypeDictHide(int allotId)
public ComparisonResponse GetComparison(ComparisonPagingRequest request) public ComparisonResponse GetComparison(ComparisonPagingRequest request)
{ {
var result = new ComparisonResponse(); var result = new ComparisonResponse();
if (request.ViewName == "view_check_dept") if (request.ViewName == "view_check_dept")
{
result.Heads = ComparisonConfig.DeptHeads; result.Heads = ComparisonConfig.DeptHeads;
else result.Datas = peremployeeRepository.CheckAccountingUnitRealGiveFeeDiff(request.AllotId, request.SearchQuery);
}
else if (request.ViewName == "view_check_emp")
{
result.Heads = ComparisonConfig.EmpHeads; result.Heads = ComparisonConfig.EmpHeads;
result.Datas = peremployeeRepository.CheckEmployeeRealGiveFeeDiff(request.AllotId, request.SearchQuery);
result.Datas = peremployeeRepository.GetComparison(request); }
else
{
result.Datas = new Comparison { Datas = new List<view_check_emp>(), TotalCount = 0 };
}
//result.Datas = peremployeeRepository.GetComparison(request);
return result; return result;
} }
......
...@@ -60,6 +60,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -60,6 +60,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
specialUnit.QuantitativeIndicatorsValue = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue()); specialUnit.QuantitativeIndicatorsValue = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
if (NopiSevice.TryGetPoint(perHeader, "人数", out point)) if (NopiSevice.TryGetPoint(perHeader, "人数", out point))
specialUnit.Number = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue()); specialUnit.Number = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
if (NopiSevice.TryGetPoint(perHeader, "实发绩效", out point))
specialUnit.RealGiveFee = ConvertHelper.To<decimal?>(row.GetCell(point).GetValue());
ICell cell = null; ICell cell = null;
if (NopiSevice.TryGetPoint(perHeader, "科室", out int kspoint)) if (NopiSevice.TryGetPoint(perHeader, "科室", out int kspoint))
......
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