|
@@ -9,6 +9,7 @@ using System.Threading.Tasks;
|
|
using wispro.sp.entity;
|
|
using wispro.sp.entity;
|
|
using wispro.sp.share;
|
|
using wispro.sp.share;
|
|
using wispro.sp.web.Auth;
|
|
using wispro.sp.web.Auth;
|
|
|
|
+using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
|
|
|
|
|
namespace wispro.sp.web.Services
|
|
namespace wispro.sp.web.Services
|
|
{
|
|
{
|
|
@@ -17,7 +18,7 @@ namespace wispro.sp.web.Services
|
|
private readonly IHttpService _httpClient;
|
|
private readonly IHttpService _httpClient;
|
|
private readonly JwtAuthenticationStateProvider _jwt;
|
|
private readonly JwtAuthenticationStateProvider _jwt;
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
public PerformanceItemServices(IHttpService httpClient, AuthenticationStateProvider jwt)
|
|
public PerformanceItemServices(IHttpService httpClient, AuthenticationStateProvider jwt)
|
|
{
|
|
{
|
|
@@ -25,14 +26,14 @@ namespace wispro.sp.web.Services
|
|
_jwt = (JwtAuthenticationStateProvider)jwt;
|
|
_jwt = (JwtAuthenticationStateProvider)jwt;
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<ListApiResponse<PerformanceItem>> GetItems(int _pageIndex,int _pageSize)
|
|
|
|
|
|
+ public async Task<ListApiResponse<PerformanceItem>> GetItems(int _pageIndex, int _pageSize)
|
|
{
|
|
{
|
|
ListApiResponse<PerformanceItem> data = await _httpClient.Get<ListApiResponse<PerformanceItem>>($"PerformanceItem/Query?pageIndex={_pageIndex}&pageSize={_pageSize}");
|
|
ListApiResponse<PerformanceItem> data = await _httpClient.Get<ListApiResponse<PerformanceItem>>($"PerformanceItem/Query?pageIndex={_pageIndex}&pageSize={_pageSize}");
|
|
return data;
|
|
return data;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<ApiSaveResponse> SaveFieldChange(int id,string Field,string value)
|
|
|
|
|
|
+ public async Task<ApiSaveResponse> SaveFieldChange(int id, string Field, string value)
|
|
{
|
|
{
|
|
ApiSaveResponse data = await _httpClient.Get<ApiSaveResponse>($"PerformanceItem/UpdateFieldValue?id={id}&field={Field}&value={value}");
|
|
ApiSaveResponse data = await _httpClient.Get<ApiSaveResponse>($"PerformanceItem/UpdateFieldValue?id={id}&field={Field}&value={value}");
|
|
return data;
|
|
return data;
|
|
@@ -44,13 +45,13 @@ namespace wispro.sp.web.Services
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<ListApiResponse<PerformanceItem>> GetMyList(int userid,jxType type,int pageIndex=1,int pageSize=5)
|
|
|
|
|
|
+ public async Task<ListApiResponse<PerformanceItem>> GetMyList(int userid, jxType type, int pageIndex = 1, int pageSize = 5)
|
|
{
|
|
{
|
|
ListApiResponse<PerformanceItem> data = await _httpClient.Get<ListApiResponse<PerformanceItem>>($"PerformanceItem/GetMyList?userid={userid}&Type={Convert.ToInt32(type)}&pageIndex={pageIndex}&pageSize={pageSize}");
|
|
ListApiResponse<PerformanceItem> data = await _httpClient.Get<ListApiResponse<PerformanceItem>>($"PerformanceItem/GetMyList?userid={userid}&Type={Convert.ToInt32(type)}&pageIndex={pageIndex}&pageSize={pageSize}");
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
public async Task<FileProcessTask> ExportData(int calMonthId)
|
|
public async Task<FileProcessTask> ExportData(int calMonthId)
|
|
{
|
|
{
|
|
QueryFilter query = new QueryFilter();
|
|
QueryFilter query = new QueryFilter();
|
|
@@ -64,10 +65,10 @@ namespace wispro.sp.web.Services
|
|
var fileData = await _httpClient.Post<FileProcessTask>($"PerformanceItem/ExportData", query);
|
|
var fileData = await _httpClient.Post<FileProcessTask>($"PerformanceItem/ExportData", query);
|
|
|
|
|
|
return fileData;
|
|
return fileData;
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<FileProcessTask> ExportJXReport(int Year,int month)
|
|
|
|
|
|
+ public async Task<FileProcessTask> ExportJXReport(int Year, int month)
|
|
{
|
|
{
|
|
var fileData = await _httpClient.Get<FileProcessTask>($"PerformanceItem/GetStaticsReport?Year={Year}&Month={month}");
|
|
var fileData = await _httpClient.Get<FileProcessTask>($"PerformanceItem/GetStaticsReport?Year={Year}&Month={month}");
|
|
return fileData;
|
|
return fileData;
|
|
@@ -80,7 +81,7 @@ namespace wispro.sp.web.Services
|
|
return fileData;
|
|
return fileData;
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<FileProcessTask> ExportData(int calMonthId, int userid, jxType jxType,int DoingOrReview=0)
|
|
|
|
|
|
+ public async Task<FileProcessTask> ExportData(int calMonthId, int userid, jxType jxType, int DoingOrReview = 0)
|
|
{
|
|
{
|
|
QueryFilter query = new QueryFilter();
|
|
QueryFilter query = new QueryFilter();
|
|
query.userId = userid;
|
|
query.userId = userid;
|
|
@@ -93,7 +94,7 @@ namespace wispro.sp.web.Services
|
|
query.ConditionTree = new List<FieldCondition>();
|
|
query.ConditionTree = new List<FieldCondition>();
|
|
query.Sorts = new List<OrderField>();
|
|
query.Sorts = new List<OrderField>();
|
|
|
|
|
|
- var fileData = await _httpClient.Post<FileProcessTask>($"PerformanceItem/ExportData", query);
|
|
|
|
|
|
+ var fileData = await _httpClient.Post<FileProcessTask>($"PerformanceItem/ExportData", query);
|
|
|
|
|
|
return fileData;
|
|
return fileData;
|
|
}
|
|
}
|
|
@@ -105,7 +106,7 @@ namespace wispro.sp.web.Services
|
|
return fileData;
|
|
return fileData;
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<ListApiResponse<PerformanceItem>> Query(CalMonth calMonth,int pageIndex,int pageSize,string sortFieldName)
|
|
|
|
|
|
+ public async Task<ListApiResponse<PerformanceItem>> Query(CalMonth calMonth, int pageIndex, int pageSize, string sortFieldName)
|
|
{
|
|
{
|
|
QueryFilter query = new QueryFilter();
|
|
QueryFilter query = new QueryFilter();
|
|
query.userId = 0;
|
|
query.userId = 0;
|
|
@@ -122,14 +123,14 @@ namespace wispro.sp.web.Services
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
var data = await _httpClient.Post<ListApiResponse<PerformanceItem>>($"PerformanceItem/QueryFilter", query);
|
|
var data = await _httpClient.Post<ListApiResponse<PerformanceItem>>($"PerformanceItem/QueryFilter", query);
|
|
return data;
|
|
return data;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<FileProcessTask> FinishedCalMonth(CalMonth calMonth)
|
|
|
|
|
|
+ public async Task<FileProcessTask> FinishedCalMonth(CalMonth calMonth)
|
|
{
|
|
{
|
|
var ret = await _httpClient.Get<FileProcessTask>($"PerformanceItem/FinishedCalMonth?year={calMonth.Year}&month={calMonth.Month}");
|
|
var ret = await _httpClient.Get<FileProcessTask>($"PerformanceItem/FinishedCalMonth?year={calMonth.Year}&month={calMonth.Month}");
|
|
return ret;
|
|
return ret;
|
|
@@ -233,7 +234,7 @@ namespace wispro.sp.web.Services
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<ListApiResponse<PerformanceItem>> Query(int calMonthId, int userid, jxType type, QueryModel<PerformanceItem> queryModel,int DoingOrReview=0)
|
|
|
|
|
|
+ public async Task<ListApiResponse<PerformanceItem>> Query(int calMonthId, int userid, jxType type, QueryModel<PerformanceItem> queryModel, int DoingOrReview = 0)
|
|
{
|
|
{
|
|
QueryFilter query = new QueryFilter();
|
|
QueryFilter query = new QueryFilter();
|
|
query.CalMonthId = calMonthId;
|
|
query.CalMonthId = calMonthId;
|
|
@@ -326,7 +327,7 @@ namespace wispro.sp.web.Services
|
|
query.Sorts = new List<OrderField>();
|
|
query.Sorts = new List<OrderField>();
|
|
}
|
|
}
|
|
|
|
|
|
- var data = await _httpClient.Post<ListApiResponse<PerformanceItem>>($"PerformanceItem/QueryFilter",query);
|
|
|
|
|
|
+ var data = await _httpClient.Post<ListApiResponse<PerformanceItem>>($"PerformanceItem/QueryFilter", query);
|
|
//Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(queryModel));
|
|
//Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(queryModel));
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
@@ -335,9 +336,9 @@ namespace wispro.sp.web.Services
|
|
{
|
|
{
|
|
var data = await _httpClient.Get<ApiSaveResponse>($"PerformanceItem/RefreshFromIPEasyById?itemId={Id}");
|
|
var data = await _httpClient.Get<ApiSaveResponse>($"PerformanceItem/RefreshFromIPEasyById?itemId={Id}");
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
return await _httpClient.Get<PerformanceItem>($"PerformanceItem/PerformanceItem?Id={Id}");
|
|
return await _httpClient.Get<PerformanceItem>($"PerformanceItem/PerformanceItem?Id={Id}");
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
public async Task<List<StaffStatistics>> CalMyStatistics(int year, int month, int? userid = null)
|
|
public async Task<List<StaffStatistics>> CalMyStatistics(int year, int month, int? userid = null)
|
|
@@ -353,17 +354,30 @@ namespace wispro.sp.web.Services
|
|
}
|
|
}
|
|
|
|
|
|
#region 绩效等级计算
|
|
#region 绩效等级计算
|
|
- public async Task StatisticsLevelCount(int year ,int month)
|
|
|
|
|
|
+ public async Task StatisticsLevelCount(int year, int month)
|
|
{
|
|
{
|
|
await _httpClient.Get<bool>($"PerformanceItem/StatisticsLevelCount?year={year}&month={month}");
|
|
await _httpClient.Get<bool>($"PerformanceItem/StatisticsLevelCount?year={year}&month={month}");
|
|
}
|
|
}
|
|
|
|
|
|
public async Task<LevelStatisticsResult> CalAgentLevel(int year, int quarter, string GradeCode)
|
|
public async Task<LevelStatisticsResult> CalAgentLevel(int year, int quarter, string GradeCode)
|
|
{
|
|
{
|
|
- var data =await _httpClient.Get<LevelStatisticsResult>($"PerformanceItem/CalAgentLevel?year={year}&quarter={quarter}&GradeCode={GradeCode}");
|
|
|
|
|
|
+ var data = await _httpClient.Get<LevelStatisticsResult>($"PerformanceItem/CalAgentLevel?year={year}&quarter={quarter}&GradeCode={GradeCode}");
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public async Task<List<AllocationRatio>> getARatios(PerformanceItem item)
|
|
|
|
+ {
|
|
|
|
+ var data = await _httpClient.Get<List<AllocationRatio>>($"PerformanceItem/CalAllocationRatios?itemId={item.Id}");
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public async Task SaveAllocationRatios(List<AllocationRatio> allocationRatios)
|
|
|
|
+ {
|
|
|
|
+ await _httpClient.Post($"PerformanceItem/SaveAllocationRatios", allocationRatios);
|
|
|
|
+
|
|
|
|
+ //throw new NotImplementedException();
|
|
|
|
+ }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
|