change TestScheme
This commit is contained in:
@@ -100,5 +100,10 @@ public class EditEmployeeGroupList
|
||||
/// </summary>
|
||||
public long SchemeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره گروه
|
||||
/// </summary>
|
||||
public string GroupNo { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -94,4 +94,9 @@ public class BaseYearDataList
|
||||
/// آیا تاریخ پایان کار دارد
|
||||
/// </summary>
|
||||
public bool HasLeftWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره گروه
|
||||
/// </summary>
|
||||
public string GroupNo { get; set; }
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public class ClassificationEmployeeRepository : RepositoryBase<long, Classificat
|
||||
/// <returns></returns>
|
||||
public async Task<List<EditEmployeeGroupList>> GetEmployeeMemberizeData(long employeeId)
|
||||
{
|
||||
return await _context.ClassificationEmployees.Where(x => x.EmployeeId == employeeId).Select(x=> new EditEmployeeGroupList
|
||||
return await _context.ClassificationEmployees.Where(x => x.EmployeeId == employeeId).Include(x=>x.ClassificationGroup).Select(x=> new EditEmployeeGroupList
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
@@ -196,6 +196,8 @@ public class ClassificationEmployeeRepository : RepositoryBase<long, Classificat
|
||||
EndGroupDate = x.EndGroupDate,
|
||||
StartGroupDateFa = x.StartGroupDate.HasValue ? x.StartGroupDate.ToFarsi() : "",
|
||||
EndGroupDateFa = x.EndGroupDate.HasValue ? x.EndGroupDate.ToFarsi() : "",
|
||||
GroupNo = x.ClassificationGroup.GroupNo
|
||||
|
||||
|
||||
}).OrderBy(x=>x.StartGroupDate).ToListAsync();
|
||||
|
||||
|
||||
@@ -100,6 +100,39 @@ public class ClassificationSchemeRepository :RepositoryBase<long, Classification
|
||||
baseYearResult.WorkshopId = workshopId;
|
||||
baseYearResult.EmployeeId = employeeId;
|
||||
|
||||
//بدست آوردن اطلاعات گروهبندی پرسنل
|
||||
var employeeGroupMember = await _context.ClassificationEmployees.Include(x=>x.ClassificationGroup)
|
||||
.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId).OrderBy(x=>x.StartGroupDate)
|
||||
.Select(x=> new{x.StartGroupDate, x.EndGroupDate, x.ClassificationGroup.GroupNo})
|
||||
.OrderByDescending(x=>x.StartGroupDate)
|
||||
.ToListAsync();
|
||||
var employeeGroupMemberData = new List<(DateTime startGroupDate, DateTime EndGroupDate, string GroupNo)>();
|
||||
if (employeeGroupMember.Any())
|
||||
{
|
||||
|
||||
var lastGroup = employeeGroupMember.FirstOrDefault();
|
||||
foreach (var group in employeeGroupMember)
|
||||
{
|
||||
if (group == lastGroup)
|
||||
{
|
||||
|
||||
employeeGroupMemberData.Add(new ValueTuple<DateTime, DateTime, string>(group.StartGroupDate.Value, contractEnd, group.GroupNo));
|
||||
}
|
||||
else
|
||||
{
|
||||
var endOfGroup = employeeGroupMemberData.Last().startGroupDate.AddDays(-1);
|
||||
employeeGroupMemberData.Add(new ValueTuple<DateTime, DateTime, string>(group.StartGroupDate.Value, endOfGroup, group.GroupNo));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//لیست شروع بکار / ترک کار پرسنل
|
||||
@@ -325,7 +358,7 @@ public class ClassificationSchemeRepository :RepositoryBase<long, Classification
|
||||
}
|
||||
|
||||
double selectBase = 0;
|
||||
var baseList = new List<(double baseYaer, DateTime start, DateTime end, string baseYearPay, DateTime baseYearPayGr, string year, bool hasStartWork, bool hasLeftWork)>();
|
||||
var baseList = new List<(double baseYaer, DateTime start, DateTime end, string baseYearPay, DateTime baseYearPayGr, string year, bool hasStartWork, bool hasLeftWork, string groupNo)>();
|
||||
|
||||
|
||||
if (baseYearDateList.Count > 0)
|
||||
@@ -335,8 +368,11 @@ public class ClassificationSchemeRepository :RepositoryBase<long, Classification
|
||||
var firstbasicSalari =
|
||||
salary.FirstOrDefault(x => x.StartDate <= firstBaseYearDate && x.EndDate >= firstBaseYearDate);
|
||||
var firstClassifiedBaseYear = classifiedBaseYearList.FirstOrDefault(x => x.StartDate <= firstBaseYearDate && x.EndDate >= firstBaseYearDate);
|
||||
|
||||
|
||||
//پایه سنوات سال جاری
|
||||
var firstGroupData = employeeGroupMemberData.FirstOrDefault(x => x.startGroupDate <= firstBaseYearDate && x.EndGroupDate >= firstBaseYearDate);
|
||||
|
||||
groupNo = firstGroupData.GroupNo;
|
||||
var firstBasicObject = Tools.GetDynamicDouble(firstClassifiedBaseYear, $"Group{groupNo}");
|
||||
double firstBasic = firstBasicObject != null ? firstBasicObject.Value : 0;
|
||||
var firstfixFeePercentage = firstbasicSalari
|
||||
@@ -350,7 +386,7 @@ public class ClassificationSchemeRepository :RepositoryBase<long, Classification
|
||||
//var afterSalary = salary.Where(x => x.StartDate > firstbasicSalari.EndDate).ToList();
|
||||
|
||||
|
||||
var first = (firstBasic, firstbasicSalari.StartDate, firstbasicSalari.EndDate, firstBaseYearDate.ToFarsi(), firstBaseYearDate, firstbasicSalari.Year, false, false);
|
||||
var first = (firstBasic, firstbasicSalari.StartDate, firstbasicSalari.EndDate, firstBaseYearDate.ToFarsi(), firstBaseYearDate, firstbasicSalari.Year, false, false, $"گروه {groupNo}");
|
||||
baseList.Add(first);
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.WriteLine($"{1398} -> firstBasic : {firstBasic}");
|
||||
@@ -396,6 +432,11 @@ public class ClassificationSchemeRepository :RepositoryBase<long, Classification
|
||||
var percntBaseYear = ((lastReecord.baseYaer * fixFeePercentage) / 100) + lastReecord.baseYaer;
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
|
||||
|
||||
var transferGroupData = employeeGroupMemberData.FirstOrDefault(x => x.startGroupDate <= currentBaseYear.EndDate && x.EndGroupDate >= currentBaseYear.StartDate);
|
||||
|
||||
groupNo = transferGroupData.GroupNo;
|
||||
|
||||
var currentBasicObject = Tools.GetDynamicDouble(currentBaseYear, $"Group{groupNo}");
|
||||
double currentBasic = currentBasicObject != null ? currentBasicObject.Value : 0;
|
||||
//var currentBasic = currentSalary
|
||||
@@ -428,7 +469,7 @@ public class ClassificationSchemeRepository :RepositoryBase<long, Classification
|
||||
Console.ResetColor();
|
||||
|
||||
// var round = GetCurrectFirstDailyFee(currentBase, $"{year}");
|
||||
var record = (baseYear, currentSalary.StartDate, currentSalary.EndDate, baseYearPay, baseYearPayDayGr, currentSalary.Year, false, false);
|
||||
var record = (baseYear, currentSalary.StartDate, currentSalary.EndDate, baseYearPay, baseYearPayDayGr, currentSalary.Year, false, false, $"گروه {groupNo}");
|
||||
baseList.Add(record);
|
||||
|
||||
|
||||
@@ -446,12 +487,12 @@ public class ClassificationSchemeRepository :RepositoryBase<long, Classification
|
||||
//افزودن تاریخ های شروع بکار و ترک کار به لیست
|
||||
foreach (var left in leftWorkList)
|
||||
{
|
||||
var startWork = (0, new DateTime(), new DateTime(), left.StartWorkDateGr.ToFarsi(), left.StartWorkDateGr, "-", true, false);
|
||||
var startWork = (0, new DateTime(), new DateTime(), left.StartWorkDateGr.ToFarsi(), left.StartWorkDateGr, "-", true, false, "");
|
||||
baseList.Add(startWork);
|
||||
|
||||
if (left.HasLeft)
|
||||
{
|
||||
var leftWork = (0, new DateTime(), new DateTime(), left.LeftWorkDateGr.ToFarsi(), left.LeftWorkDateGr, "-", false, true);
|
||||
var leftWork = (0, new DateTime(), new DateTime(), left.LeftWorkDateGr.ToFarsi(), left.LeftWorkDateGr, "-", false, true, "");
|
||||
baseList.Add(leftWork);
|
||||
}
|
||||
|
||||
@@ -478,6 +519,7 @@ public class ClassificationSchemeRepository :RepositoryBase<long, Classification
|
||||
Year = x.year,
|
||||
HasLeftWork = x.hasLeftWork,
|
||||
HasStartWork = x.hasStartWork,
|
||||
GroupNo = x.groupNo,
|
||||
}).OrderBy(x => x.BaseYearPayDayGr).ToList(),
|
||||
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<link href="~/admintheme/css/workshop-create.css?ver=@adminVersion" rel="stylesheet" />
|
||||
<style>
|
||||
body{
|
||||
|
||||
background-color: #fefefe;
|
||||
background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232ebfbf' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
|
||||
}
|
||||
@@ -32,7 +33,7 @@
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div style="max-width: 88%;margin: 0 auto7
|
||||
<div style="max-width: 98%;margin: 0 auto">
|
||||
<div class="col-xs-12" style="float: unset;">
|
||||
<div class="handle-title">
|
||||
<h3 id="titleHead">تنظیمات طرح طبقه بندی مشاغل <span style="color: #a4884b"> > @Model.WorkshopName</span></h3>
|
||||
@@ -77,6 +78,7 @@
|
||||
<span>تعیین دستمزد گروه ها</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="li-wizard step" id="addEmployeesTab" data-url="/Admin/Company/Workshops/ClassificationScheme?handler=AddEmployeesTab">
|
||||
<a class="nav-link">
|
||||
<div class="success-icon" id="success-icon3" style="display:none;">
|
||||
|
||||
@@ -605,14 +605,35 @@ public class ClassificationSchemeModel : PageModel
|
||||
double rate = 0;
|
||||
string mathModel = "";
|
||||
var employeeMemberizeData = _classificationSchemeApplication.GetEmployeeMemberizeData(employeeId).GetAwaiter().GetResult();
|
||||
var employeeGroupMemberData = new List<(DateTime startGroupDate, DateTime EndGroupDate, string GroupNo)>();
|
||||
var employeeMemberizeDataOrderd = employeeMemberizeData.EditEmployeeGroupLists.OrderByDescending(x => x.StartGroupDate).ToList();
|
||||
if (employeeMemberizeDataOrderd.Any())
|
||||
{
|
||||
|
||||
var groupId = employeeMemberizeData.EditEmployeeGroupLists.FirstOrDefault()!.ClassificationGroupId;
|
||||
var group = _classificationSchemeApplication.GetGroups(schemeId).GetAwaiter().GetResult();
|
||||
var groupNo = group.FirstOrDefault(x => x.GroupId == groupId)!.GroupNo;
|
||||
var lastGroup = employeeMemberizeDataOrderd.FirstOrDefault();
|
||||
foreach (var group in employeeMemberizeDataOrderd)
|
||||
{
|
||||
if (group == lastGroup)
|
||||
{
|
||||
|
||||
employeeGroupMemberData.Add(new ValueTuple<DateTime, DateTime, string>(group.StartGroupDate.Value, endDateGr, group.GroupNo));
|
||||
}
|
||||
else
|
||||
{
|
||||
var endOfGroup = employeeGroupMemberData.Last().startGroupDate.AddDays(-1);
|
||||
employeeGroupMemberData.Add(new ValueTuple<DateTime, DateTime, string>(group.StartGroupDate.Value, endOfGroup, group.GroupNo));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
var groupNo = employeeMemberizeData.EditEmployeeGroupLists.FirstOrDefault()!.GroupNo;
|
||||
var salaryGroupNo = employeeGroupMemberData
|
||||
.FirstOrDefault(x => x.startGroupDate <= endDateGr && x.EndGroupDate >= startDateGr)!.GroupNo;
|
||||
var groupSalaryData = _classificationSchemeApplication.GetEditSalariesData(schemeId, startDate, endDate).GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
var salaryData = groupSalaryData.SalariesAndCoefficientList.FirstOrDefault(x => x.GroupNo == groupNo);
|
||||
var salaryData = groupSalaryData.SalariesAndCoefficientList.FirstOrDefault(x => x.GroupNo == salaryGroupNo);
|
||||
if (salaryData != null)
|
||||
{
|
||||
salary = salaryData.GroupSalary;
|
||||
@@ -624,9 +645,9 @@ public class ClassificationSchemeModel : PageModel
|
||||
coefficient = 0;
|
||||
}
|
||||
|
||||
rate = ClassificationRangeOfGroupRate.GetGroupDistanceRate(groupNo).DistanceRate;
|
||||
rate = ClassificationRangeOfGroupRate.GetGroupDistanceRate(salaryGroupNo).DistanceRate;
|
||||
|
||||
if (groupNo != "1")
|
||||
if (salaryGroupNo != "1")
|
||||
{
|
||||
salaryResult = (coefficient * rate) + salary;
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
|
||||
.st .header {
|
||||
background: #0d4c4c;
|
||||
background: #26826d;
|
||||
color: #fff;
|
||||
padding: 10px 14px;
|
||||
text-align: center;
|
||||
@@ -90,7 +90,7 @@
|
||||
}
|
||||
|
||||
.st .trTable.teal {
|
||||
background: #5fb0b0;
|
||||
background: #155c5c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -215,14 +215,18 @@
|
||||
</div>
|
||||
<div class="lineDiv compute hiddenCompute"></div>
|
||||
|
||||
<div class="row" style="text-align center">
|
||||
<div class="row" style="text-align center; justify-items: center">
|
||||
|
||||
<div class="st hiddenCompute">
|
||||
<div class="st hiddenCompute" style="width:98% !important">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="compute hiddenCompute" style="display: flex; padding-right:8px;gap:9px">
|
||||
<span ><h4>پایه سنوات</h4></span>
|
||||
</span>
|
||||
@@ -231,9 +235,7 @@
|
||||
<span>
|
||||
<h3>ریال</h3></span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="lineDiv compute hiddenCompute"></div>
|
||||
<div class="row">
|
||||
<span class="compute hiddenCompute" style="display: flex; padding-right:8px;gap:9px">
|
||||
@@ -327,7 +329,7 @@
|
||||
|
||||
<div class="trTable green">
|
||||
<div class="content">
|
||||
<div class="date">${item.baseYearPayDay}</div>
|
||||
<div class="date">${item.baseYearPayDay}<span> </span><span> </span>${item.groupNo}</div>
|
||||
<div>شروع بکار</div>
|
||||
</div>
|
||||
</div>`);
|
||||
@@ -336,7 +338,7 @@
|
||||
|
||||
<div class="trTable red">
|
||||
<div class="content">
|
||||
<div class="date">${item.baseYearPayDay}</div>
|
||||
<div class="date">${item.baseYearPayDay}<span> </span><span> </span>${item.groupNo}</div>
|
||||
<div>ترک کار</div>
|
||||
</div>
|
||||
</div>`);
|
||||
@@ -349,8 +351,9 @@
|
||||
<div class="content">
|
||||
<div>
|
||||
|
||||
<span class="date">${item.baseYearPayDay}</span>
|
||||
<span>فقط ارتقاء</span>
|
||||
<span class="date">${item.baseYearPayDay}</span> <span>فقط ارتقاء</span>
|
||||
<span> </span><span> </span><span> </span>${item.groupNo} <span> </span><span> </span>
|
||||
|
||||
</div>
|
||||
<div class="date">${item.baseYear}</div>
|
||||
</div>
|
||||
@@ -360,7 +363,8 @@
|
||||
$('.st').append(`
|
||||
<div class="trTable teal">
|
||||
<div class="content">
|
||||
<div class="date">${item.baseYearPayDay}</div>
|
||||
<div class="date">${item.baseYearPayDay}<span> </span><span> </span>${item.groupNo}</div>
|
||||
|
||||
<div class="date">${item.baseYear}</div>
|
||||
</div>
|
||||
</div>`);
|
||||
|
||||
Reference in New Issue
Block a user