Compare commits
23 Commits
Feature/Ch
...
Feature/CW
| Author | SHA1 | Date | |
|---|---|---|---|
| fb1db062f3 | |||
| 9271cb5c66 | |||
| aee7e5ce82 | |||
| 97b4c7dc66 | |||
| e3b6d5f1c9 | |||
| 7c1fe65cf2 | |||
| f26fcba165 | |||
|
|
de2a6203df | ||
|
|
2208834a0e | ||
| de52a0be98 | |||
|
|
5bebec3fde | ||
|
|
cad808d73c | ||
| abef053f56 | |||
| 6469bf5a50 | |||
|
|
4fd5ef52ef | ||
|
|
61e2bdaaf5 | ||
| 8ab22d9948 | |||
|
|
17b5f5fee5 | ||
| 9e7e4ca655 | |||
|
|
100c9367ed | ||
| fdb6799c65 | |||
|
|
c81da3e787 | ||
|
|
d8c0471878 |
@@ -150,7 +150,13 @@ public class AuthHelper : IAuthHelper
|
|||||||
{
|
{
|
||||||
#region MahanChanges
|
#region MahanChanges
|
||||||
|
|
||||||
|
if (account.Id == 322)
|
||||||
|
account.Permissions.AddRange([3060301, 30603, 30604, 30605]);
|
||||||
|
|
||||||
var permissions = account.Permissions is { Count: > 0 } ? Tools.SerializeToBson(account.Permissions) : "";
|
var permissions = account.Permissions is { Count: > 0 } ? Tools.SerializeToBson(account.Permissions) : "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var workshopBson = account.WorkshopList is { Count: > 0 } ? Tools.SerializeToBson(account.WorkshopList) : "";
|
var workshopBson = account.WorkshopList is { Count: > 0 } ? Tools.SerializeToBson(account.WorkshopList) : "";
|
||||||
var slug = account.WorkshopSlug ?? "";
|
var slug = account.WorkshopSlug ?? "";
|
||||||
|
|
||||||
|
|||||||
@@ -385,11 +385,27 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const int SetWorkshopWorkingHoursPermissionCode = 10606;
|
public const int SetWorkshopWorkingHoursPermissionCode = 10606;
|
||||||
|
|
||||||
|
#region حساب کاربری دوربین
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// تنظیمات حساب کاربری دوربین
|
/// تنظیمات حساب کاربری دوربین
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CameraAccountSettingsPermissionCode = 10607;
|
public const int CameraAccountSettingsPermissionCode = 10607;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// فعال/غیرفعال اکانت دوربین
|
||||||
|
/// </summary>
|
||||||
|
public const int CameraAccountActivationBtnPermissionCode = 1060701;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ویرایش اکانت دوربین
|
||||||
|
/// </summary>
|
||||||
|
public const int CameraAccountEditPermissionCode = 1060702;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region کارپوشه
|
#region کارپوشه
|
||||||
@@ -744,6 +760,22 @@
|
|||||||
Code = CameraAccountSettingsPermissionCode,
|
Code = CameraAccountSettingsPermissionCode,
|
||||||
ParentId = RollCallOperationsPermissionCode
|
ParentId = RollCallOperationsPermissionCode
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static SubAccountPermissionDto CameraAccountActivationBtn { get; } = new()
|
||||||
|
{
|
||||||
|
Id = CameraAccountActivationBtnPermissionCode,
|
||||||
|
Name = "فعال/غیرفعال حساب کاربری دوربین",
|
||||||
|
Code = CameraAccountActivationBtnPermissionCode,
|
||||||
|
ParentId = CameraAccountSettingsPermissionCode
|
||||||
|
};
|
||||||
|
|
||||||
|
public static SubAccountPermissionDto CameraAccountEdit { get; } = new()
|
||||||
|
{
|
||||||
|
Id = CameraAccountEditPermissionCode,
|
||||||
|
Name = "ویراش حساب کاربری دوربین",
|
||||||
|
Code = CameraAccountEditPermissionCode,
|
||||||
|
ParentId = CameraAccountSettingsPermissionCode
|
||||||
|
};
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region کارپوشه,ParentId = WorkFlowOperationsPermissionCode
|
#region کارپوشه,ParentId = WorkFlowOperationsPermissionCode
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||||
using Microsoft.EntityFrameworkCore.Design.Internal;
|
using Microsoft.EntityFrameworkCore.Design.Internal;
|
||||||
@@ -12,8 +14,7 @@ public class BaseCustomizeEntity : EntityBase
|
|||||||
}
|
}
|
||||||
public BaseCustomizeEntity(FridayPay fridayPay, OverTimePay overTimePay,
|
public BaseCustomizeEntity(FridayPay fridayPay, OverTimePay overTimePay,
|
||||||
BaseYearsPay baseYearsPay, BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
BaseYearsPay baseYearsPay, BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays,List<WeeklyOffDay> weeklyOffDays)
|
||||||
FridayWork fridayWork, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
FridayPay = fridayPay;
|
FridayPay = fridayPay;
|
||||||
@@ -29,10 +30,10 @@ public class BaseCustomizeEntity : EntityBase
|
|||||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||||
LateToWork = lateToWork;
|
LateToWork = lateToWork;
|
||||||
EarlyExit = earlyExit;
|
EarlyExit = earlyExit;
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
BreakTime = breakTime;
|
BreakTime = breakTime;
|
||||||
LeavePermittedDays = leavePermittedDays;
|
LeavePermittedDays = leavePermittedDays;
|
||||||
|
WeeklyOffDays = weeklyOffDays.Select(x=> new WeeklyOffDay(x.DayOfWeek)).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -117,4 +118,28 @@ public class BaseCustomizeEntity : EntityBase
|
|||||||
|
|
||||||
|
|
||||||
public BreakTime BreakTime { get; protected set; }
|
public BreakTime BreakTime { get; protected set; }
|
||||||
|
|
||||||
|
public List<WeeklyOffDay> WeeklyOffDays { get; set; }
|
||||||
|
|
||||||
|
public void FridayWorkToWeeklyDayOfWeek()
|
||||||
|
{
|
||||||
|
if (FridayWork == FridayWork.Default && !WeeklyOffDays.Any(x => x.DayOfWeek == DayOfWeek.Friday))
|
||||||
|
{
|
||||||
|
WeeklyOffDays.Add(new WeeklyOffDay(DayOfWeek.Friday));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WeeklyOffDay
|
||||||
|
{
|
||||||
|
public WeeklyOffDay(DayOfWeek dayOfWeek)
|
||||||
|
{
|
||||||
|
DayOfWeek = dayOfWeek;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long Id { get; set; }
|
||||||
|
public DayOfWeek DayOfWeek { get; set; }
|
||||||
|
public long ParentId { get; set; }
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,7 @@ public class TaskSchedule:EntityBase
|
|||||||
UnitType = unitType;
|
UnitType = unitType;
|
||||||
UnitNumber = unitNumber;
|
UnitNumber = unitNumber;
|
||||||
LastEndTaskDate = lastEndTaskDate;
|
LastEndTaskDate = lastEndTaskDate;
|
||||||
IsActive = IsActive.False;
|
IsActive = IsActive.True;
|
||||||
}
|
}
|
||||||
public string Count { get; private set; }
|
public string Count { get; private set; }
|
||||||
public TaskScheduleType Type { get; private set; }
|
public TaskScheduleType Type { get; private set; }
|
||||||
|
|||||||
@@ -27,12 +27,13 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
|||||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, long employeeId,
|
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, long employeeId,
|
||||||
long workshopId, double salary, long customizeWorkshopGroupSettingId,
|
long workshopId, double salary, long customizeWorkshopGroupSettingId,
|
||||||
ICollection<CustomizeWorkshopEmployeeSettingsShift> customizeWorkshopEmployeeSettingsShifts,
|
ICollection<CustomizeWorkshopEmployeeSettingsShift> customizeWorkshopEmployeeSettingsShifts,
|
||||||
FridayWork fridayWork,
|
HolidayWork holidayWork, IrregularShift irregularShift, WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime,
|
||||||
HolidayWork holidayWork, IrregularShift irregularShift, WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts) :
|
int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts
|
||||||
|
, List<WeeklyOffDay> weeklyOffDays) :
|
||||||
base(fridayPay, overTimePay,
|
base(fridayPay, overTimePay,
|
||||||
baseYearsPay, bonusesPay, nightWorkPay,
|
baseYearsPay, bonusesPay, nightWorkPay,
|
||||||
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
||||||
earlyExit, fridayWork, holidayWork, breakTime, leavePermittedDays)
|
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
|
||||||
{
|
{
|
||||||
CustomizeWorkshopGroupSettingId = customizeWorkshopGroupSettingId;
|
CustomizeWorkshopGroupSettingId = customizeWorkshopGroupSettingId;
|
||||||
IsSettingChanged = false;
|
IsSettingChanged = false;
|
||||||
@@ -82,7 +83,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
|||||||
/// <param name="fineAbsenceDeduction">جریمه غیبت</param>
|
/// <param name="fineAbsenceDeduction">جریمه غیبت</param>
|
||||||
/// <param name="lateToWork">تاخیر در ورود</param>
|
/// <param name="lateToWork">تاخیر در ورود</param>
|
||||||
/// <param name="earlyExit">تعجیل درخروج</param>
|
/// <param name="earlyExit">تعجیل درخروج</param>
|
||||||
/// <param name="fridayWork">آیا در روز های جمعه موظف به کار است</param>
|
|
||||||
/// <param name="holidayWork">آیا در تعطیلات رسمی موظف به کار است</param>
|
/// <param name="holidayWork">آیا در تعطیلات رسمی موظف به کار است</param>
|
||||||
/// <param name="workshopIrregularShifts">نوع شیفت کاری </param>
|
/// <param name="workshopIrregularShifts">نوع شیفت کاری </param>
|
||||||
/// <param name="workshopShiftStatus">آیا شیفت منظم است یا نا منظم</param>
|
/// <param name="workshopShiftStatus">آیا شیفت منظم است یا نا منظم</param>
|
||||||
@@ -91,7 +91,7 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
|||||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
||||||
FridayWork fridayWork, HolidayWork holidayWork, IrregularShift irregularShift, bool isSettingChange, int leavePermittedDays)
|
HolidayWork holidayWork, IrregularShift irregularShift, bool isSettingChange, int leavePermittedDays)
|
||||||
{
|
{
|
||||||
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
|
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
|
||||||
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
|
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
|
||||||
@@ -99,7 +99,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
|||||||
|
|
||||||
Salary = salary;
|
Salary = salary;
|
||||||
IsSettingChanged = isSettingChange;
|
IsSettingChanged = isSettingChange;
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
LeavePermittedDays = leavePermittedDays;
|
LeavePermittedDays = leavePermittedDays;
|
||||||
}
|
}
|
||||||
@@ -112,8 +111,8 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
|||||||
public void SimpleEdit(
|
public void SimpleEdit(
|
||||||
ICollection<CustomizeWorkshopEmployeeSettingsShift> employeeSettingsShift,
|
ICollection<CustomizeWorkshopEmployeeSettingsShift> employeeSettingsShift,
|
||||||
IrregularShift irregularShift,
|
IrregularShift irregularShift,
|
||||||
WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange, FridayWork fridayWork, HolidayWork holidayWork,
|
WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange,HolidayWork holidayWork,
|
||||||
ICollection<CustomizeRotatingShift> rotatingShifts)
|
ICollection<CustomizeRotatingShift> rotatingShifts,List<WeeklyOffDay> weeklyOffDays)
|
||||||
{
|
{
|
||||||
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
||||||
IsShiftChanged = isShiftChange;
|
IsShiftChanged = isShiftChange;
|
||||||
@@ -126,9 +125,8 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
|||||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||||
|
|
||||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||||
|
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
|
WeeklyOffDays = weeklyOffDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -269,4 +267,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
|||||||
|
|
||||||
IsShiftChanged = isShiftChange;
|
IsShiftChanged = isShiftChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,11 +27,12 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay,
|
FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay,
|
||||||
BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork,
|
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
||||||
HolidayWork holidayWork, BreakTime breakTime, WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts) :
|
HolidayWork holidayWork, BreakTime breakTime, WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, int leavePermittedDays,
|
||||||
|
ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays) :
|
||||||
base(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
|
base(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
|
||||||
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
||||||
earlyExit, fridayWork, holidayWork, breakTime, leavePermittedDays)
|
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
|
||||||
{
|
{
|
||||||
GroupName = groupName;
|
GroupName = groupName;
|
||||||
Salary = salary;
|
Salary = salary;
|
||||||
@@ -76,7 +77,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||||
LateToWork lateToWork, EarlyExit earlyExit,
|
LateToWork lateToWork, EarlyExit earlyExit,
|
||||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, FridayWork fridayWork,
|
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
|
||||||
HolidayWork holidayWork, IrregularShift irregularShift, ICollection<CustomizeRotatingShift> rotatingShifts,
|
HolidayWork holidayWork, IrregularShift irregularShift, ICollection<CustomizeRotatingShift> rotatingShifts,
|
||||||
WorkshopShiftStatus workshopShiftStatus, long customizeWorkshopSettingId, BreakTime breakTime, int leavePermittedDays)
|
WorkshopShiftStatus workshopShiftStatus, long customizeWorkshopSettingId, BreakTime breakTime, int leavePermittedDays)
|
||||||
{
|
{
|
||||||
@@ -96,7 +97,6 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||||
LateToWork = lateToWork;
|
LateToWork = lateToWork;
|
||||||
EarlyExit = earlyExit;
|
EarlyExit = earlyExit;
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
LeavePermittedDays = leavePermittedDays;
|
LeavePermittedDays = leavePermittedDays;
|
||||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||||
@@ -123,7 +123,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
||||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||||
LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
|
LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
|
||||||
{
|
{
|
||||||
GroupName = groupName;
|
GroupName = groupName;
|
||||||
Salary = salary;
|
Salary = salary;
|
||||||
@@ -140,7 +140,6 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||||
LateToWork = lateToWork;
|
LateToWork = lateToWork;
|
||||||
EarlyExit = earlyExit;
|
EarlyExit = earlyExit;
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
IsSettingChange = isSettingChange;
|
IsSettingChange = isSettingChange;
|
||||||
LeavePermittedDays = leavePermittedDays;
|
LeavePermittedDays = leavePermittedDays;
|
||||||
@@ -154,7 +153,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
{
|
{
|
||||||
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
|
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
|
||||||
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
|
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
|
||||||
LateToWork, EarlyExit, FridayWork, HolidayWork, IrregularShift, false, leavePermittedDays);
|
LateToWork, EarlyExit, HolidayWork, IrregularShift, false, leavePermittedDays);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void EditAndOverwriteOnAllEmployees(string groupName, double salary,
|
public void EditAndOverwriteOnAllEmployees(string groupName, double salary,
|
||||||
@@ -162,14 +161,13 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
||||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||||
LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
|
LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
|
||||||
{
|
{
|
||||||
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
|
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
|
||||||
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
|
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
|
||||||
lateToWork, earlyExit);
|
lateToWork, earlyExit);
|
||||||
GroupName = groupName;
|
GroupName = groupName;
|
||||||
Salary = salary;
|
Salary = salary;
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
IsSettingChange = isSettingChange;
|
IsSettingChange = isSettingChange;
|
||||||
LeavePermittedDays = leavePermittedDays;
|
LeavePermittedDays = leavePermittedDays;
|
||||||
@@ -182,7 +180,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
{
|
{
|
||||||
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
|
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
|
||||||
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
|
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
|
||||||
LateToWork, EarlyExit, FridayWork, HolidayWork, IrregularShift, false, leavePermittedDays);
|
LateToWork, EarlyExit, HolidayWork, IrregularShift, false, leavePermittedDays);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +193,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
|
|
||||||
public void EditSimpleAndOverwriteOnEmployee(string groupName, IEnumerable<long> employeeIds,
|
public void EditSimpleAndOverwriteOnEmployee(string groupName, IEnumerable<long> employeeIds,
|
||||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, WorkshopShiftStatus workshopShiftStatus,
|
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, WorkshopShiftStatus workshopShiftStatus,
|
||||||
IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange, FridayWork fridayWork, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts)
|
IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays)
|
||||||
{
|
{
|
||||||
GroupName = groupName;
|
GroupName = groupName;
|
||||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||||
@@ -209,9 +207,11 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
|
|
||||||
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
||||||
IsShiftChange = isShiftChange;
|
IsShiftChange = isShiftChange;
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
|
|
||||||
|
WeeklyOffDays = weeklyOffDays;
|
||||||
|
|
||||||
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
|
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
|
||||||
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||||
if (isShiftChange)
|
if (isShiftChange)
|
||||||
@@ -227,7 +227,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
.ToList();
|
.ToList();
|
||||||
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
|
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
|
||||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
|
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
|
||||||
IrregularShift, WorkshopShiftStatus, BreakTime, false, FridayWork, HolidayWork, newRotatingShifts);
|
IrregularShift, WorkshopShiftStatus, BreakTime, false, HolidayWork, newRotatingShifts,WeeklyOffDays.ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -235,7 +235,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
public void EditSimpleAndOverwriteOnAllEmployees(string groupName,
|
public void EditSimpleAndOverwriteOnAllEmployees(string groupName,
|
||||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
|
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
|
||||||
WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange,
|
WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange,
|
||||||
FridayWork fridayWork, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts)
|
HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts ,List<WeeklyOffDay> weeklyOffDays)
|
||||||
{
|
{
|
||||||
GroupName = groupName;
|
GroupName = groupName;
|
||||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||||
@@ -251,8 +251,8 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
||||||
IsShiftChange = isShiftChange;
|
IsShiftChange = isShiftChange;
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
FridayWork = fridayWork;
|
|
||||||
|
|
||||||
|
WeeklyOffDays = weeklyOffDays;
|
||||||
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
|
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
|
||||||
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||||
|
|
||||||
@@ -262,7 +262,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
.ToList();
|
.ToList();
|
||||||
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
|
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
|
||||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
|
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
|
||||||
irregularShift, workshopShiftStatus, breakTime, false, FridayWork, HolidayWork, newRotatingShifts);
|
irregularShift, workshopShiftStatus, breakTime, false, HolidayWork, newRotatingShifts,WeeklyOffDays.ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -298,13 +298,14 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
|||||||
IrregularShift irregularShift = new(IrregularShift.StartTime, IrregularShift.EndTime,
|
IrregularShift irregularShift = new(IrregularShift.StartTime, IrregularShift.EndTime,
|
||||||
IrregularShift.WorkshopIrregularShifts);
|
IrregularShift.WorkshopIrregularShifts);
|
||||||
BreakTime breakTime = new(BreakTime.HasBreakTimeValue, BreakTime.BreakTimeValue);
|
BreakTime breakTime = new(BreakTime.HasBreakTimeValue, BreakTime.BreakTimeValue);
|
||||||
|
List<WeeklyOffDay> weeklyOffDays = WeeklyOffDays.Select(x => new WeeklyOffDay(x.DayOfWeek)).ToList();
|
||||||
|
|
||||||
var rotatingShift = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime)).ToList();
|
var rotatingShift = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime)).ToList();
|
||||||
|
|
||||||
var customizeWorkshopEmployeeSettings = new CustomizeWorkshopEmployeeSettings(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
|
var customizeWorkshopEmployeeSettings = new CustomizeWorkshopEmployeeSettings(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
|
||||||
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
||||||
earlyExit, employeeId, workshopId, Salary, id, shifts, FridayWork, HolidayWork, irregularShift,
|
earlyExit, employeeId, workshopId, Salary, id, shifts, HolidayWork, irregularShift,
|
||||||
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift);
|
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift, weeklyOffDays);
|
||||||
|
|
||||||
CustomizeWorkshopEmployeeSettingsCollection.Add(customizeWorkshopEmployeeSettings);
|
CustomizeWorkshopEmployeeSettingsCollection.Add(customizeWorkshopEmployeeSettings);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
|||||||
|
|
||||||
public CustomizeWorkshopSettings(long workshopId,
|
public CustomizeWorkshopSettings(long workshopId,
|
||||||
ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts, int leavePermittedDays,
|
ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts, int leavePermittedDays,
|
||||||
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
|
WorkshopShiftStatus workshopShiftStatus,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
|
||||||
{
|
{
|
||||||
FridayPay = new FridayPay(FridayPayType.None, 0);
|
FridayPay = new FridayPay(FridayPayType.None, 0);
|
||||||
OverTimePay = new OverTimePay(OverTimePayType.None, 0);
|
OverTimePay = new OverTimePay(OverTimePayType.None, 0);
|
||||||
@@ -38,11 +38,10 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
|||||||
OverTimeThresholdMinute = 0;
|
OverTimeThresholdMinute = 0;
|
||||||
Currency = Currency.Rial;
|
Currency = Currency.Rial;
|
||||||
MaxMonthDays = MaxMonthDays.Default;
|
MaxMonthDays = MaxMonthDays.Default;
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
|
||||||
BonusesPaysInEndOfMonth = BonusesPaysInEndOfYear.EndOfYear;
|
BonusesPaysInEndOfMonth = BonusesPaysInEndOfYear.EndOfYear;
|
||||||
WorkshopShiftStatus = workshopShiftStatus;
|
WorkshopShiftStatus = workshopShiftStatus;
|
||||||
|
WeeklyOffDays = weeklyOffDays;
|
||||||
|
HolidayWork = holidayWork;
|
||||||
if (workshopShiftStatus == WorkshopShiftStatus.Irregular)
|
if (workshopShiftStatus == WorkshopShiftStatus.Irregular)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -92,8 +91,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
|||||||
public void Edit(FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay,
|
public void Edit(FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay,
|
||||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BonusesPaysInEndOfYear bonusesPaysInEndOfYear,
|
||||||
FridayWork fridayWork, HolidayWork holidayWork, BonusesPaysInEndOfYear bonusesPaysInEndOfYear,
|
|
||||||
int leavePermittedDays, BaseYearsPayInEndOfYear baseYearsPayInEndOfYear, int overTimeThresholdMinute)
|
int leavePermittedDays, BaseYearsPayInEndOfYear baseYearsPayInEndOfYear, int overTimeThresholdMinute)
|
||||||
{
|
{
|
||||||
FridayPay = fridayPay;
|
FridayPay = fridayPay;
|
||||||
@@ -109,7 +107,6 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
|||||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||||
LateToWork = lateToWork;
|
LateToWork = lateToWork;
|
||||||
EarlyExit = earlyExit;
|
EarlyExit = earlyExit;
|
||||||
FridayWork = fridayWork;
|
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
BonusesPaysInEndOfMonth = bonusesPaysInEndOfYear;
|
BonusesPaysInEndOfMonth = bonusesPaysInEndOfYear;
|
||||||
LeavePermittedDays = leavePermittedDays;
|
LeavePermittedDays = leavePermittedDays;
|
||||||
@@ -127,19 +124,18 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeWorkshopShifts(ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts,
|
public void ChangeWorkshopShifts(ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts,
|
||||||
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
|
WorkshopShiftStatus workshopShiftStatus,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
|
||||||
{
|
{
|
||||||
WorkshopShiftStatus = workshopShiftStatus;
|
WorkshopShiftStatus = workshopShiftStatus;
|
||||||
HolidayWork = holidayWork;
|
HolidayWork = holidayWork;
|
||||||
FridayWork = fridayWork;
|
|
||||||
CustomizeWorkshopSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopSettingsShifts : new List<CustomizeWorkshopSettingsShift>();
|
CustomizeWorkshopSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopSettingsShifts : new List<CustomizeWorkshopSettingsShift>();
|
||||||
|
WeeklyOffDays = weeklyOffDays;
|
||||||
|
|
||||||
if (workshopShiftStatus == WorkshopShiftStatus.Regular)
|
if (workshopShiftStatus == WorkshopShiftStatus.Regular)
|
||||||
{
|
{
|
||||||
var date = new DateOnly();
|
var date = new DateOnly();
|
||||||
var firstStartShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MinBy(x => x.Placement).StartTime);
|
var firstStartShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MinBy(x => x.Placement).StartTime);
|
||||||
var lastEndShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MaxBy(x => x.Placement).EndTime);
|
var lastEndShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MaxBy(x => x.Placement).EndTime);
|
||||||
|
|
||||||
|
|
||||||
if (lastEndShift > firstStartShift)
|
if (lastEndShift > firstStartShift)
|
||||||
firstStartShift = firstStartShift.AddDays(1);
|
firstStartShift = firstStartShift.AddDays(1);
|
||||||
var offSet = (firstStartShift - lastEndShift).Divide(2);
|
var offSet = (firstStartShift - lastEndShift).Divide(2);
|
||||||
|
|||||||
@@ -52,5 +52,8 @@ public interface ILeftWorkInsuranceRepository : IRepository<long, LeftWorkInsura
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
List<LeftWorkViewModel> GetEmployeesWithContractExitOnly(long workshopId);
|
List<LeftWorkViewModel> GetEmployeesWithContractExitOnly(long workshopId);
|
||||||
|
|
||||||
|
LeftWorkInsurance GetLastLeftWorkByEmployeeIdAndWorkshopId(long workshopId, long employeeId);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,18 @@ namespace Company.Domain.RollCallAgg;
|
|||||||
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||||
{
|
{
|
||||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
|
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="employeeId"></param>
|
||||||
|
/// <param name="workshopId"></param>
|
||||||
|
/// <param name="contractStart"></param>
|
||||||
|
/// <param name="contractEnd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
(bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
|
||||||
|
DateTime contractStart, DateTime contractEnd);
|
||||||
|
|
||||||
TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate);
|
TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate);
|
||||||
|
|
||||||
List<RotatingShiftViewModel> RotatingShiftCheck(List<GroupedRollCalls> rollCallList);
|
List<RotatingShiftViewModel> RotatingShiftCheck(List<GroupedRollCalls> rollCallList);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||||
@@ -16,8 +17,9 @@ public class CreateCustomizeWorkshopGroupSettings
|
|||||||
public IrregularShift IrregularShift { get; set; }
|
public IrregularShift IrregularShift { get; set; }
|
||||||
public BreakTime BreakTime { get; set; }
|
public BreakTime BreakTime { get; set; }
|
||||||
public int LeavePermittedDays { get; set; }
|
public int LeavePermittedDays { get; set; }
|
||||||
public FridayWork FridayWork { get; set; }
|
//public FridayWork FridayWork { get; set; }
|
||||||
public HolidayWork HolidayWork { get; set; }
|
public HolidayWork HolidayWork { get; set; }
|
||||||
|
public List<DayOfWeek> OffDayOfWeeks { get; set; }
|
||||||
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
|
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
using System;
|
||||||
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
@@ -20,16 +21,18 @@ public class CreateCustomizeWorkshopSettings
|
|||||||
public BreakTime BreakTime { get; set; }
|
public BreakTime BreakTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// آیا جمعه کار میکند یا نه
|
///// آیا جمعه کار میکند یا نه
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public FridayWork FridayWork { get; set; }
|
//public FridayWork FridayWork { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// آیا در روز های تعطیل کار میکند
|
/// آیا در روز های تعطیل کار میکند
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HolidayWork HolidayWork { get; set; }
|
public HolidayWork HolidayWork { get; set; }
|
||||||
|
|
||||||
|
public List<DayOfWeek> OffDays { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
using System;
|
||||||
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@@ -20,7 +21,8 @@ public class CustomizeWorkshopEmployeeSettingsViewModel
|
|||||||
public bool ChangeSettingEmployeeShiftIsChange { get; set; }
|
public bool ChangeSettingEmployeeShiftIsChange { get; set; }
|
||||||
public BreakTime BreakTime { get; set; }
|
public BreakTime BreakTime { get; set; }
|
||||||
public HolidayWork HolidayWork { get; set; }
|
public HolidayWork HolidayWork { get; set; }
|
||||||
public FridayWork FridayWork { get; set; }
|
//public FridayWork FridayWork { get; set; }
|
||||||
public int LeavePermittedDays { get; set; }
|
public int LeavePermittedDays { get; set; }
|
||||||
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
|
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
|
||||||
|
public List<DayOfWeek> WeeklyOffDays { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
using System;
|
||||||
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||||
@@ -72,16 +73,18 @@ public class EditCustomizeEmployeeSettings:CreateCustomizeEmployeeSettings
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public EarlyExitViewModel EarlyExit { get; set; }
|
public EarlyExitViewModel EarlyExit { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// آیا جمعه کار میکند یا نه
|
///// آیا جمعه کار میکند یا نه
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public FridayWork FridayWork { get; set; }
|
//public FridayWork FridayWork { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// آیا در روز های تعطیل کار میکند
|
/// آیا در روز های تعطیل کار میکند
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HolidayWork HolidayWork { get; set; }
|
public HolidayWork HolidayWork { get; set; }
|
||||||
|
|
||||||
|
public List<DayOfWeek> WeeklyOffDays { get; set; }
|
||||||
|
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Salary { get; set; }
|
public string Salary { get; set; }
|
||||||
public string NameGroup { get; set; }
|
public string NameGroup { get; set; }
|
||||||
@@ -91,4 +94,5 @@ public class EditCustomizeEmployeeSettings:CreateCustomizeEmployeeSettings
|
|||||||
public IEnumerable<CustomizeWorkshopShiftViewModel> ShiftViewModel { get; set; }
|
public IEnumerable<CustomizeWorkshopShiftViewModel> ShiftViewModel { get; set; }
|
||||||
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShifts{ get; set; }
|
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShifts{ get; set; }
|
||||||
public BreakTime BreakTime { get; set; }
|
public BreakTime BreakTime { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
using System;
|
||||||
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using _0_Framework.Domain.CustomizeCheckoutShared.Base;
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||||
|
|
||||||
@@ -75,16 +77,18 @@ public class EditCustomizeWorkshopGroupSettings : CreateCustomizeWorkshopGroupSe
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public EarlyExitViewModel EarlyExit { get; set; }
|
public EarlyExitViewModel EarlyExit { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// آیا جمعه کار میکند یا نه
|
///// آیا جمعه کار میکند یا نه
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public FridayWork FridayWork { get; set; }
|
//public FridayWork FridayWork { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// آیا در روز های تعطیل کار میکند
|
/// آیا در روز های تعطیل کار میکند
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HolidayWork HolidayWork { get; set; }
|
public HolidayWork HolidayWork { get; set; }
|
||||||
|
|
||||||
|
//public List<DayOfWeek> WeeklyOffDays { get; set; }
|
||||||
|
|
||||||
public bool IsShiftChanged { get; set; }
|
public bool IsShiftChanged { get; set; }
|
||||||
public bool IsSettingChanged { get; set; }
|
public bool IsSettingChanged { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using _0_Framework.Application;
|
using System;
|
||||||
|
using _0_Framework.Application;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||||
using CompanyManagment.App.Contracts.Employee;
|
using CompanyManagment.App.Contracts.Employee;
|
||||||
@@ -51,11 +52,14 @@ public interface ICustomizeWorkshopSettingsApplication
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="shiftViewModels">شیفت هت</param>
|
/// <param name="shiftViewModels">شیفت هت</param>
|
||||||
/// <param name="customizeWorkshopSettingsId">آیدی تنظیمات کارگاه</param>
|
/// <param name="customizeWorkshopSettingsId">آیدی تنظیمات کارگاه</param>
|
||||||
/// <param name="replaceChangedGroups"></param>
|
|
||||||
/// <param name="workshopShiftStatus"></param>
|
/// <param name="workshopShiftStatus"></param>
|
||||||
|
/// <param name="holidayWork"></param>
|
||||||
|
/// <param name="weeklyOffDays"></param>
|
||||||
|
/// <param name="replaceChangedGroups"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||||
long customizeWorkshopSettingsId,WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork);
|
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,
|
||||||
|
HolidayWork holidayWork, List<DayOfWeek> weeklyOffDays);
|
||||||
|
|
||||||
// It will Get the Workshop Settings with its groups and the employees of groups.
|
// It will Get the Workshop Settings with its groups and the employees of groups.
|
||||||
CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth);
|
CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth);
|
||||||
|
|||||||
@@ -38,4 +38,5 @@ public interface IRollCallEmployeeApplication
|
|||||||
(int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId);
|
(int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId);
|
||||||
bool HasEmployees(long workshopId);
|
bool HasEmployees(long workshopId);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,5 +17,7 @@ namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus
|
|||||||
List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr);
|
List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr);
|
||||||
|
|
||||||
bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
|
bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
|
||||||
|
void SyncRollCallEmployeeWithLeftWork(long rollCallEmployeeId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Transactions;
|
using System.Transactions;
|
||||||
|
using _0_Framework.Domain.CustomizeCheckoutShared.Base;
|
||||||
using CompanyManagment.App.Contracts.RollCall;
|
using CompanyManagment.App.Contracts.RollCall;
|
||||||
using Microsoft.EntityFrameworkCore.Query;
|
using Microsoft.EntityFrameworkCore.Query;
|
||||||
using Company.Domain.CheckoutAgg;
|
using Company.Domain.CheckoutAgg;
|
||||||
@@ -153,8 +154,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var offDays = command.OffDays.Select(x => new WeeklyOffDay(x)).ToList();
|
||||||
|
|
||||||
var record = new CustomizeWorkshopSettings(workshopId, shiftCollection, command.LeavePermittedDays,
|
var record = new CustomizeWorkshopSettings(workshopId, shiftCollection, command.LeavePermittedDays,
|
||||||
command.WorkshopShiftStatus, command.FridayWork, command.HolidayWork);
|
command.WorkshopShiftStatus, command.HolidayWork, offDays);
|
||||||
using (var transaction = new TransactionScope())
|
using (var transaction = new TransactionScope())
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -339,12 +342,13 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
double salary = command.Salary.MoneyToDouble();
|
double salary = command.Salary.MoneyToDouble();
|
||||||
|
|
||||||
|
var weeklyOffDays = command.OffDayOfWeeks.Select(x => new WeeklyOffDay(x)).ToList();
|
||||||
|
|
||||||
var entity = new CustomizeWorkshopGroupSettings(command.Name, salary, command.CustomizeWorkshopSettingId, shiftCollection, workshopSettings.FridayPay, workshopSettings.OverTimePay,
|
var entity = new CustomizeWorkshopGroupSettings(command.Name, salary, command.CustomizeWorkshopSettingId, shiftCollection, workshopSettings.FridayPay, workshopSettings.OverTimePay,
|
||||||
workshopSettings.BaseYearsPay, workshopSettings.BonusesPay, workshopSettings.NightWorkPay, workshopSettings.MarriedAllowance,
|
workshopSettings.BaseYearsPay, workshopSettings.BonusesPay, workshopSettings.NightWorkPay, workshopSettings.MarriedAllowance,
|
||||||
workshopSettings.ShiftPay, workshopSettings.FamilyAllowance, workshopSettings.LeavePay, workshopSettings.InsuranceDeduction, workshopSettings.FineAbsenceDeduction,
|
workshopSettings.ShiftPay, workshopSettings.FamilyAllowance, workshopSettings.LeavePay, workshopSettings.InsuranceDeduction, workshopSettings.FineAbsenceDeduction,
|
||||||
workshopSettings.LateToWork, workshopSettings.EarlyExit, command.FridayWork,
|
workshopSettings.LateToWork, workshopSettings.EarlyExit,
|
||||||
command.HolidayWork, breakTime, command.WorkshopShiftStatus, command.IrregularShift, command.LeavePermittedDays, customizeRotatingShifts);
|
command.HolidayWork, breakTime, command.WorkshopShiftStatus, command.IrregularShift, command.LeavePermittedDays, customizeRotatingShifts, workshopSettings.WeeklyOffDays);
|
||||||
|
|
||||||
_customizeWorkshopGroupSettingsRepository.Create(entity);
|
_customizeWorkshopGroupSettingsRepository.Create(entity);
|
||||||
|
|
||||||
@@ -383,6 +387,8 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
var isChanged = false;
|
var isChanged = false;
|
||||||
#region validation
|
#region validation
|
||||||
|
|
||||||
|
var commandOffDayHashSet = command.WeeklyOffDays.ToHashSet();
|
||||||
|
var groupOffDayHashSet = customizeWorkshopGroupSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet();
|
||||||
|
|
||||||
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
|
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
|
||||||
{
|
{
|
||||||
@@ -468,9 +474,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (shiftCollection.All(x => customizeWorkshopGroupSettings.CustomizeWorkshopGroupSettingsShifts.Any(y => x.Equals(y)))
|
if (shiftCollection.All(x => customizeWorkshopGroupSettings.CustomizeWorkshopGroupSettingsShifts.Any(y => x.Equals(y)))
|
||||||
&& command.WorkshopShiftStatus == customizeWorkshopGroupSettings.WorkshopShiftStatus && command.FridayWork == customizeWorkshopGroupSettings.FridayWork &&
|
&& command.WorkshopShiftStatus == customizeWorkshopGroupSettings.WorkshopShiftStatus && command.HolidayWork == customizeWorkshopGroupSettings.HolidayWork &&
|
||||||
command.HolidayWork == customizeWorkshopGroupSettings.HolidayWork && command.BreakTime == customizeWorkshopGroupSettings.BreakTime)
|
command.BreakTime == customizeWorkshopGroupSettings.BreakTime &&commandOffDayHashSet.SetEquals(groupOffDayHashSet))
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
}
|
}
|
||||||
@@ -508,7 +515,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (command.WorkshopShiftStatus == customizeWorkshopGroupSettings.WorkshopShiftStatus && command.BreakTime == customizeWorkshopGroupSettings.BreakTime &&
|
if (command.WorkshopShiftStatus == customizeWorkshopGroupSettings.WorkshopShiftStatus && command.BreakTime == customizeWorkshopGroupSettings.BreakTime &&
|
||||||
command.IrregularShift == customizeWorkshopGroupSettings.IrregularShift && command.FridayWork == customizeWorkshopGroupSettings.FridayWork &&
|
command.IrregularShift == customizeWorkshopGroupSettings.IrregularShift && commandOffDayHashSet.SetEquals(groupOffDayHashSet) &&
|
||||||
command.HolidayWork == customizeWorkshopGroupSettings.HolidayWork)
|
command.HolidayWork == customizeWorkshopGroupSettings.HolidayWork)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -530,7 +537,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
if (rotatingShift.All(x => customizeWorkshopGroupSettings.CustomizeRotatingShifts.Any(y => x.Equals(y)))
|
if (rotatingShift.All(x => customizeWorkshopGroupSettings.CustomizeRotatingShifts.Any(y => x.Equals(y)))
|
||||||
&& command.WorkshopShiftStatus == customizeWorkshopGroupSettings.WorkshopShiftStatus &&
|
&& command.WorkshopShiftStatus == customizeWorkshopGroupSettings.WorkshopShiftStatus &&
|
||||||
command.FridayWork == customizeWorkshopGroupSettings.FridayWork &&
|
commandOffDayHashSet.SetEquals(groupOffDayHashSet) &&
|
||||||
command.HolidayWork == customizeWorkshopGroupSettings.HolidayWork && command.BreakTime == customizeWorkshopGroupSettings.BreakTime)
|
command.HolidayWork == customizeWorkshopGroupSettings.HolidayWork && command.BreakTime == customizeWorkshopGroupSettings.BreakTime)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -553,11 +560,11 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
customizeWorkshopGroupSettings.BaseYearsPay, customizeWorkshopGroupSettings.BonusesPay, customizeWorkshopGroupSettings.NightWorkPay, customizeWorkshopGroupSettings.MarriedAllowance,
|
customizeWorkshopGroupSettings.BaseYearsPay, customizeWorkshopGroupSettings.BonusesPay, customizeWorkshopGroupSettings.NightWorkPay, customizeWorkshopGroupSettings.MarriedAllowance,
|
||||||
customizeWorkshopGroupSettings.ShiftPay, customizeWorkshopGroupSettings.FamilyAllowance, customizeWorkshopGroupSettings.LeavePay, customizeWorkshopGroupSettings.InsuranceDeduction, customizeWorkshopGroupSettings.FineAbsenceDeduction,
|
customizeWorkshopGroupSettings.ShiftPay, customizeWorkshopGroupSettings.FamilyAllowance, customizeWorkshopGroupSettings.LeavePay, customizeWorkshopGroupSettings.InsuranceDeduction, customizeWorkshopGroupSettings.FineAbsenceDeduction,
|
||||||
customizeWorkshopGroupSettings.LateToWork, customizeWorkshopGroupSettings.EarlyExit, command.EmployeeIds.First(), command.WorkshopId, customizeWorkshopGroupSettings.Salary, command.GroupId,
|
customizeWorkshopGroupSettings.LateToWork, customizeWorkshopGroupSettings.EarlyExit, command.EmployeeIds.First(), command.WorkshopId, customizeWorkshopGroupSettings.Salary, command.GroupId,
|
||||||
shiftCollection, command.FridayWork, command.HolidayWork, command.IrregularShift, command.WorkshopShiftStatus, breakTime, command.LeavePermittedDays, rotatingShift);
|
shiftCollection, command.HolidayWork, command.IrregularShift, command.WorkshopShiftStatus, breakTime, command.LeavePermittedDays, rotatingShift, customizeWorkshopGroupSettings.WeeklyOffDays);
|
||||||
|
|
||||||
_customizeWorkshopEmployeeSettingsRepository.Create(entity);
|
_customizeWorkshopEmployeeSettingsRepository.Create(entity);
|
||||||
|
|
||||||
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.FridayWork, command.HolidayWork, rotatingShift);
|
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.HolidayWork, rotatingShift, customizeWorkshopGroupSettings.WeeklyOffDays.ToList());
|
||||||
|
|
||||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||||
return op.Succcedded();
|
return op.Succcedded();
|
||||||
@@ -568,7 +575,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
}
|
}
|
||||||
|
|
||||||
public OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels, long customizeWorkshopSettingsId,
|
public OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels, long customizeWorkshopSettingsId,
|
||||||
WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork)
|
WorkshopShiftStatus workshopShiftStatus, HolidayWork holidayWork, List<DayOfWeek> weeklyOffDays)
|
||||||
{
|
{
|
||||||
OperationResult op = new OperationResult();
|
OperationResult op = new OperationResult();
|
||||||
var entity = _customizeWorkshopSettingsRepository.Get(customizeWorkshopSettingsId);
|
var entity = _customizeWorkshopSettingsRepository.Get(customizeWorkshopSettingsId);
|
||||||
@@ -660,8 +667,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
var offDays = weeklyOffDays.Select(x => new WeeklyOffDay(x)).ToList();
|
||||||
|
|
||||||
using var transActionScope = new TransactionScope();
|
using var transActionScope = new TransactionScope();
|
||||||
entity.ChangeWorkshopShifts(shiftCollection, workshopShiftStatus, fridayWork, holidayWork);
|
entity.ChangeWorkshopShifts(shiftCollection, workshopShiftStatus, holidayWork, offDays);
|
||||||
|
|
||||||
|
|
||||||
//op = ChangeAllGroupsShiftsWithEmployees(entity, replaceChangedGroups);
|
//op = ChangeAllGroupsShiftsWithEmployees(entity, replaceChangedGroups);
|
||||||
@@ -708,6 +717,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
var groupSettingsShifts = new List<CustomizeWorkshopGroupSettingsShift>();
|
var groupSettingsShifts = new List<CustomizeWorkshopGroupSettingsShift>();
|
||||||
ICollection<CustomizeRotatingShift> rotatingShift = [];
|
ICollection<CustomizeRotatingShift> rotatingShift = [];
|
||||||
bool isChanged;
|
bool isChanged;
|
||||||
|
|
||||||
|
var commandOffDayHashSet = command.OffDayOfWeeks.ToHashSet();
|
||||||
|
var workshopOffDayHashSet = workshopSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet();
|
||||||
|
|
||||||
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
|
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -723,7 +736,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
if (groupSettingsShifts.All(x => workshopSettings.CustomizeWorkshopSettingsShifts.Any(y => x.Equals(y)))
|
if (groupSettingsShifts.All(x => workshopSettings.CustomizeWorkshopSettingsShifts.Any(y => x.Equals(y)))
|
||||||
&& command.WorkshopShiftStatus == workshopSettings.WorkshopShiftStatus && command.FridayWork == workshopSettings.FridayWork &&
|
&& command.WorkshopShiftStatus == workshopSettings.WorkshopShiftStatus && commandOffDayHashSet.SetEquals(workshopOffDayHashSet) &&
|
||||||
command.HolidayWork == workshopSettings.HolidayWork &&
|
command.HolidayWork == workshopSettings.HolidayWork &&
|
||||||
command.BreakTime == workshopSettings.BreakTime)
|
command.BreakTime == workshopSettings.BreakTime)
|
||||||
{
|
{
|
||||||
@@ -762,7 +775,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (command.WorkshopShiftStatus == workshopSettings.WorkshopShiftStatus && command.BreakTime == workshopSettings.BreakTime
|
if (command.WorkshopShiftStatus == workshopSettings.WorkshopShiftStatus && command.BreakTime == workshopSettings.BreakTime
|
||||||
&& command.FridayWork == workshopSettings.FridayWork &&
|
&& commandOffDayHashSet.SetEquals(workshopOffDayHashSet) &&
|
||||||
command.HolidayWork == workshopSettings.HolidayWork)
|
command.HolidayWork == workshopSettings.HolidayWork)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -782,7 +795,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
rotatingShift = command.CustomizeRotatingShiftsViewModels
|
rotatingShift = command.CustomizeRotatingShiftsViewModels
|
||||||
.Select(x => new CustomizeRotatingShift(TimeOnly.Parse(x.StartTime), TimeOnly.Parse(x.EndTime))).ToList();
|
.Select(x => new CustomizeRotatingShift(TimeOnly.Parse(x.StartTime), TimeOnly.Parse(x.EndTime))).ToList();
|
||||||
if (command.WorkshopShiftStatus == workshopSettings.WorkshopShiftStatus && command.BreakTime == workshopSettings.BreakTime
|
if (command.WorkshopShiftStatus == workshopSettings.WorkshopShiftStatus && command.BreakTime == workshopSettings.BreakTime
|
||||||
&& command.FridayWork == workshopSettings.FridayWork &&
|
&& commandOffDayHashSet.SetEquals(workshopOffDayHashSet) &&
|
||||||
command.HolidayWork == workshopSettings.HolidayWork)
|
command.HolidayWork == workshopSettings.HolidayWork)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -805,10 +818,11 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
var notSelectedEmployeeSettings = employeeSettings.Where(x => !selectedEmployeesIds.Contains(x.EmployeeId));
|
var notSelectedEmployeeSettings = employeeSettings.Where(x => !selectedEmployeesIds.Contains(x.EmployeeId));
|
||||||
|
|
||||||
|
var weeklyOffDays = command.OffDayOfWeeks.Select(x => new WeeklyOffDay(x)).ToList();
|
||||||
using var transaction = new TransactionScope();
|
using var transaction = new TransactionScope();
|
||||||
|
|
||||||
entity.EditSimpleAndOverwriteOnEmployee(command.Name, selectedEmployeesIds, groupSettingsShifts, command.WorkshopShiftStatus,
|
entity.EditSimpleAndOverwriteOnEmployee(command.Name, selectedEmployeesIds, groupSettingsShifts, command.WorkshopShiftStatus,
|
||||||
command.IrregularShift, breakTime, isChanged, command.FridayWork, command.HolidayWork, rotatingShift);
|
command.IrregularShift, breakTime, isChanged, command.HolidayWork, rotatingShift, weeklyOffDays);
|
||||||
if (reCalculateCommand.Count > 0)
|
if (reCalculateCommand.Count > 0)
|
||||||
{
|
{
|
||||||
var result = _rollCallApplication.RecalculateValues(workshopSettings.WorkshopId, reCalculateCommand);
|
var result = _rollCallApplication.RecalculateValues(workshopSettings.WorkshopId, reCalculateCommand);
|
||||||
@@ -851,6 +865,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
ICollection<CustomizeRotatingShift> rotatingShift = [];
|
ICollection<CustomizeRotatingShift> rotatingShift = [];
|
||||||
bool isChanged = false;
|
bool isChanged = false;
|
||||||
|
|
||||||
|
var commandOffDayHashSet = command.WeeklyOffDays.ToHashSet();
|
||||||
|
var groupOffDayHashSet = groupSettings.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet();
|
||||||
|
|
||||||
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
|
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -938,7 +956,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
|
|
||||||
if (employeesShifts.All(x => groupSettings.CustomizeWorkshopGroupSettingsShifts.Any(y => x.Equals(y)))
|
if (employeesShifts.All(x => groupSettings.CustomizeWorkshopGroupSettingsShifts.Any(y => x.Equals(y)))
|
||||||
&& command.WorkshopShiftStatus == groupSettings.WorkshopShiftStatus && command.FridayWork == groupSettings.FridayWork &&
|
&& command.WorkshopShiftStatus == groupSettings.WorkshopShiftStatus && commandOffDayHashSet.SetEquals(groupOffDayHashSet) &&
|
||||||
command.HolidayWork == groupSettings.HolidayWork && command.BreakTime == groupSettings.BreakTime)
|
command.HolidayWork == groupSettings.HolidayWork && command.BreakTime == groupSettings.BreakTime)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -978,7 +996,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (command.WorkshopShiftStatus == groupSettings.WorkshopShiftStatus && command.BreakTime == groupSettings.BreakTime &&
|
if (command.WorkshopShiftStatus == groupSettings.WorkshopShiftStatus && command.BreakTime == groupSettings.BreakTime &&
|
||||||
command.IrregularShift == groupSettings.IrregularShift && command.FridayWork == groupSettings.FridayWork &&
|
command.IrregularShift == groupSettings.IrregularShift && commandOffDayHashSet.SetEquals(groupOffDayHashSet) &&
|
||||||
command.HolidayWork == groupSettings.HolidayWork)
|
command.HolidayWork == groupSettings.HolidayWork)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -999,7 +1017,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
.Select(x => new CustomizeRotatingShift(TimeOnly.Parse(x.StartTime), TimeOnly.Parse(x.EndTime))).ToList();
|
.Select(x => new CustomizeRotatingShift(TimeOnly.Parse(x.StartTime), TimeOnly.Parse(x.EndTime))).ToList();
|
||||||
|
|
||||||
if (rotatingShift.All(x => groupSettings.CustomizeRotatingShifts.Any(y => x.Equals(y)))
|
if (rotatingShift.All(x => groupSettings.CustomizeRotatingShifts.Any(y => x.Equals(y)))
|
||||||
&& command.WorkshopShiftStatus == groupSettings.WorkshopShiftStatus && command.FridayWork == groupSettings.FridayWork &&
|
&& command.WorkshopShiftStatus == groupSettings.WorkshopShiftStatus && commandOffDayHashSet.SetEquals(groupOffDayHashSet) &&
|
||||||
command.HolidayWork == groupSettings.HolidayWork && command.BreakTime == groupSettings.BreakTime)
|
command.HolidayWork == groupSettings.HolidayWork && command.BreakTime == groupSettings.BreakTime)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -1012,10 +1030,11 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var weeklyOffDays = command.WeeklyOffDays.Select(x => new WeeklyOffDay(x)).ToList();
|
||||||
using var transaction = new TransactionScope();
|
using var transaction = new TransactionScope();
|
||||||
|
|
||||||
entity.SimpleEdit(employeesShifts, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime,
|
entity.SimpleEdit(employeesShifts, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime,
|
||||||
isChanged, command.FridayWork, command.HolidayWork, rotatingShift);
|
isChanged, command.HolidayWork, rotatingShift, weeklyOffDays);
|
||||||
|
|
||||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||||
if (reCalculateCommand.Count > 0)
|
if (reCalculateCommand.Count > 0)
|
||||||
@@ -1188,13 +1207,13 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
groupData.id,
|
groupData.id,
|
||||||
shifts.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement))
|
shifts.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement))
|
||||||
.ToList(),
|
.ToList(),
|
||||||
groupData.FridayWork,
|
|
||||||
groupData.HolidayWork,
|
groupData.HolidayWork,
|
||||||
groupData.IrregularShift,
|
groupData.IrregularShift,
|
||||||
groupData.WorkshopShiftStatus,
|
groupData.WorkshopShiftStatus,
|
||||||
new(groupData.BreakTime.HasBreakTimeValue, groupData.BreakTime.BreakTimeValue),
|
new(groupData.BreakTime.HasBreakTimeValue, groupData.BreakTime.BreakTimeValue),
|
||||||
command.LeavePermittedDays,
|
command.LeavePermittedDays,
|
||||||
groupData.CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime)).ToList()
|
groupData.CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime)).ToList(),
|
||||||
|
groupData.WeeklyOffDays
|
||||||
);
|
);
|
||||||
|
|
||||||
_customizeWorkshopEmployeeSettingsRepository.Create(entity);
|
_customizeWorkshopEmployeeSettingsRepository.Create(entity);
|
||||||
@@ -1260,7 +1279,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
{
|
{
|
||||||
entity.Edit(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay, marriedAllowance, shiftPay,
|
entity.Edit(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay, marriedAllowance, shiftPay,
|
||||||
familyAllowance, leavePay, insuranceDeduction,
|
familyAllowance, leavePay, insuranceDeduction,
|
||||||
fineAbsenceDeduction, lateToWork, earlyExit, command.FridayWork, command.HolidayWork,
|
fineAbsenceDeduction, lateToWork, earlyExit, command.HolidayWork,
|
||||||
command.BonusesPaysInEndOfMonth, command.LeavePermittedDays, command.BaseYearsPayInEndOfYear,
|
command.BonusesPaysInEndOfMonth, command.LeavePermittedDays, command.BaseYearsPayInEndOfYear,
|
||||||
command.OverTimeThresholdMinute);
|
command.OverTimeThresholdMinute);
|
||||||
|
|
||||||
@@ -1358,7 +1377,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
if (fridayPay == entity.FridayPay && overTimePay == entity.OverTimePay && baseYearsPay == entity.BaseYearsPay && bonusesPay == entity.BonusesPay
|
if (fridayPay == entity.FridayPay && overTimePay == entity.OverTimePay && baseYearsPay == entity.BaseYearsPay && bonusesPay == entity.BonusesPay
|
||||||
&& shiftPay == entity.ShiftPay && nightWorkPay == entity.NightWorkPay && marriedAllowance == entity.MarriedAllowance
|
&& shiftPay == entity.ShiftPay && nightWorkPay == entity.NightWorkPay && marriedAllowance == entity.MarriedAllowance
|
||||||
&& familyAllowance == entity.FamilyAllowance && leavePay == entity.LeavePay && insuranceDeduction == entity.InsuranceDeduction
|
&& familyAllowance == entity.FamilyAllowance && leavePay == entity.LeavePay && insuranceDeduction == entity.InsuranceDeduction
|
||||||
&& fineAbsenceDeduction == entity.FineAbsenceDeduction && lateToWork == entity.LateToWork && earlyExit == entity.EarlyExit && command.FridayWork == entity.FridayWork
|
&& fineAbsenceDeduction == entity.FineAbsenceDeduction && lateToWork == entity.LateToWork && earlyExit == entity.EarlyExit
|
||||||
&& command.HolidayWork == entity.HolidayWork && command.IrregularShift == entity.IrregularShift && command.WorkshopShiftStatus == entity.WorkshopShiftStatus)
|
&& command.HolidayWork == entity.HolidayWork && command.IrregularShift == entity.IrregularShift && command.WorkshopShiftStatus == entity.WorkshopShiftStatus)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -1369,8 +1388,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
}
|
}
|
||||||
entity.EditAndOverwriteOnEmployees(command.Name, salary, command.EmployeeIds, fridayPay, overTimePay,
|
entity.EditAndOverwriteOnEmployees(command.Name, salary, command.EmployeeIds, fridayPay, overTimePay,
|
||||||
baseYearsPay, bonusesPay, shiftPay, nightWorkPay, marriedAllowance, familyAllowance,
|
baseYearsPay, bonusesPay, shiftPay, nightWorkPay, marriedAllowance, familyAllowance,
|
||||||
leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork, earlyExit,
|
leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork, earlyExit, command.HolidayWork, isChanged, command.LeavePermittedDays);
|
||||||
command.FridayWork, command.HolidayWork, isChanged, command.LeavePermittedDays);
|
|
||||||
|
|
||||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||||
|
|
||||||
@@ -1418,12 +1436,14 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
|
|
||||||
double salary = command.Salary.MoneyToDouble();
|
double salary = command.Salary.MoneyToDouble();
|
||||||
|
|
||||||
|
var commandOffDayHashSet = command.WeeklyOffDays.ToHashSet();
|
||||||
|
var entityOffDayHashSet = entity.WeeklyOffDays.Select(x => x.DayOfWeek).ToHashSet();
|
||||||
|
|
||||||
bool isChanged;
|
bool isChanged;
|
||||||
if (fridayPay == entity.FridayPay && overTimePay == entity.OverTimePay && baseYearsPay == entity.BaseYearsPay && bonusesPay == entity.BonusesPay
|
if (fridayPay == entity.FridayPay && overTimePay == entity.OverTimePay && baseYearsPay == entity.BaseYearsPay && bonusesPay == entity.BonusesPay
|
||||||
&& shiftPay == entity.ShiftPay && nightWorkPay == entity.NightWorkPay && marriedAllowance == entity.MarriedAllowance
|
&& shiftPay == entity.ShiftPay && nightWorkPay == entity.NightWorkPay && marriedAllowance == entity.MarriedAllowance
|
||||||
&& familyAllowance == entity.FamilyAllowance && leavePay == entity.LeavePay && insuranceDeduction == entity.InsuranceDeduction
|
&& familyAllowance == entity.FamilyAllowance && leavePay == entity.LeavePay && insuranceDeduction == entity.InsuranceDeduction
|
||||||
&& fineAbsenceDeduction == entity.FineAbsenceDeduction && lateToWork == entity.LateToWork && earlyExit == entity.EarlyExit && command.FridayWork == entity.FridayWork
|
&& fineAbsenceDeduction == entity.FineAbsenceDeduction && lateToWork == entity.LateToWork && earlyExit == entity.EarlyExit && commandOffDayHashSet.SetEquals(entityOffDayHashSet)
|
||||||
&& command.HolidayWork == entity.HolidayWork)
|
&& command.HolidayWork == entity.HolidayWork)
|
||||||
{
|
{
|
||||||
isChanged = false;
|
isChanged = false;
|
||||||
@@ -1436,7 +1456,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
//change employee data manually. It changes the 'IsChanged' property to true.
|
//change employee data manually. It changes the 'IsChanged' property to true.
|
||||||
entity.EditEmployees(salary, fridayPay, overTimePay, baseYearsPay,
|
entity.EditEmployees(salary, fridayPay, overTimePay, baseYearsPay,
|
||||||
bonusesPay, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay,
|
bonusesPay, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay,
|
||||||
insuranceDeduction, fineAbsenceDeduction, lateToWork, earlyExit, command.FridayWork, command.HolidayWork, command.IrregularShift, isChanged, command.LeavePermittedDays);
|
insuranceDeduction, fineAbsenceDeduction, lateToWork, earlyExit, command.HolidayWork, command.IrregularShift, isChanged, command.LeavePermittedDays);
|
||||||
|
|
||||||
|
|
||||||
_customizeWorkshopEmployeeSettingsRepository.SaveChanges();
|
_customizeWorkshopEmployeeSettingsRepository.SaveChanges();
|
||||||
@@ -1509,8 +1529,9 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
Placement = x.Placement,
|
Placement = x.Placement,
|
||||||
StartTime = x.StartTime.ToString("HH:mm")
|
StartTime = x.StartTime.ToString("HH:mm")
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
FridayWork = entity.FridayWork,
|
//FridayWork = entity.FridayWork,
|
||||||
HolidayWork = entity.HolidayWork,
|
HolidayWork = entity.HolidayWork,
|
||||||
|
WeeklyOffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList(),
|
||||||
CustomizeRotatingShiftsViewModels = entity.CustomizeRotatingShifts.Select(x => new CustomizeRotatingShiftsViewModel()
|
CustomizeRotatingShiftsViewModels = entity.CustomizeRotatingShifts.Select(x => new CustomizeRotatingShiftsViewModel()
|
||||||
{
|
{
|
||||||
StartTime = x.StartTime.ToString("HH:mm"),
|
StartTime = x.StartTime.ToString("HH:mm"),
|
||||||
@@ -1651,7 +1672,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
var customizeWorkshopGroupSettings = new CustomizeWorkshopGroupSettings().CreateMainGroup(entity.FridayPay, entity.OverTimePay,
|
var customizeWorkshopGroupSettings = new CustomizeWorkshopGroupSettings().CreateMainGroup(entity.FridayPay, entity.OverTimePay,
|
||||||
entity.BaseYearsPay, entity.BonusesPay, entity.ShiftPay, entity.NightWorkPay, entity.MarriedAllowance,
|
entity.BaseYearsPay, entity.BonusesPay, entity.ShiftPay, entity.NightWorkPay, entity.MarriedAllowance,
|
||||||
entity.FamilyAllowance, entity.LeavePay, entity.InsuranceDeduction, entity.FineAbsenceDeduction,
|
entity.FamilyAllowance, entity.LeavePay, entity.InsuranceDeduction, entity.FineAbsenceDeduction,
|
||||||
entity.LateToWork, entity.EarlyExit, shifts, entity.FridayWork, entity.HolidayWork,
|
entity.LateToWork, entity.EarlyExit, shifts, entity.HolidayWork,
|
||||||
irregularShift, [], entity.WorkshopShiftStatus, entity.id, new BreakTime(false, new TimeOnly()), entity.LeavePermittedDays);
|
irregularShift, [], entity.WorkshopShiftStatus, entity.id, new BreakTime(false, new TimeOnly()), entity.LeavePermittedDays);
|
||||||
|
|
||||||
_customizeWorkshopGroupSettingsRepository.Create(customizeWorkshopGroupSettings);
|
_customizeWorkshopGroupSettingsRepository.Create(customizeWorkshopGroupSettings);
|
||||||
@@ -1699,7 +1720,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
{
|
{
|
||||||
customizeWorkshopGroupSettings.EditSimpleAndOverwriteOnAllEmployees(customizeWorkshopGroupSettings.GroupName,
|
customizeWorkshopGroupSettings.EditSimpleAndOverwriteOnAllEmployees(customizeWorkshopGroupSettings.GroupName,
|
||||||
groupShifts, entity.WorkshopShiftStatus, irregularShift, new BreakTime(false, new TimeOnly()),
|
groupShifts, entity.WorkshopShiftStatus, irregularShift, new BreakTime(false, new TimeOnly()),
|
||||||
false, entity.FridayWork, entity.HolidayWork, []);
|
false, entity.HolidayWork, [], []);
|
||||||
}
|
}
|
||||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||||
return op.Succcedded();
|
return op.Succcedded();
|
||||||
@@ -1725,8 +1746,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
|||||||
customizeWorkshopSettings.NightWorkPay, customizeWorkshopSettings.MarriedAllowance,
|
customizeWorkshopSettings.NightWorkPay, customizeWorkshopSettings.MarriedAllowance,
|
||||||
customizeWorkshopSettings.FamilyAllowance, customizeWorkshopSettings.LeavePay,
|
customizeWorkshopSettings.FamilyAllowance, customizeWorkshopSettings.LeavePay,
|
||||||
customizeWorkshopSettings.InsuranceDeduction, customizeWorkshopSettings.FineAbsenceDeduction,
|
customizeWorkshopSettings.InsuranceDeduction, customizeWorkshopSettings.FineAbsenceDeduction,
|
||||||
customizeWorkshopSettings.LateToWork, customizeWorkshopSettings.EarlyExit,
|
customizeWorkshopSettings.LateToWork, customizeWorkshopSettings.EarlyExit, customizeWorkshopSettings.HolidayWork, replaceInAllGroups,
|
||||||
customizeWorkshopSettings.FridayWork, customizeWorkshopSettings.HolidayWork, replaceInAllGroups,
|
|
||||||
customizeWorkshopSettings.LeavePermittedDays);
|
customizeWorkshopSettings.LeavePermittedDays);
|
||||||
}
|
}
|
||||||
_customizeWorkshopSettingsRepository.SaveChanges();
|
_customizeWorkshopSettingsRepository.SaveChanges();
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
|||||||
using Company.Domain.LeftWorkAgg;
|
using Company.Domain.LeftWorkAgg;
|
||||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||||
|
using Company.Domain.LeftWorkInsuranceAgg;
|
||||||
|
|
||||||
namespace CompanyManagment.Application;
|
namespace CompanyManagment.Application;
|
||||||
|
|
||||||
@@ -59,8 +60,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
|||||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||||
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
|
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
|
||||||
|
private readonly ILeftWorkInsuranceRepository _leftWorkInsuranceRepository ;
|
||||||
|
|
||||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository) : base(context)
|
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository, ILeftWorkInsuranceRepository leftWorkInsuranceRepository) : base(context)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_WorkShopRepository = workShopRepository;
|
_WorkShopRepository = workShopRepository;
|
||||||
@@ -77,6 +79,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
|||||||
_employeeClientTempRepository = employeeClientTempRepository;
|
_employeeClientTempRepository = employeeClientTempRepository;
|
||||||
_leftWorkRepository = leftWorkRepository;
|
_leftWorkRepository = leftWorkRepository;
|
||||||
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
|
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
|
||||||
|
_leftWorkInsuranceRepository = leftWorkInsuranceRepository;
|
||||||
_EmployeeRepository = employeeRepository;
|
_EmployeeRepository = employeeRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1009,6 +1012,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
|||||||
var startLeftWork = command.StartLeftWork.ToGeorgianDateTime();
|
var startLeftWork = command.StartLeftWork.ToGeorgianDateTime();
|
||||||
|
|
||||||
var leftWorkViewModel = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id);
|
var leftWorkViewModel = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id);
|
||||||
|
|
||||||
|
|
||||||
PersonnelCodeDomain personnelCode = null;
|
PersonnelCodeDomain personnelCode = null;
|
||||||
if (leftWorkViewModel != null)
|
if (leftWorkViewModel != null)
|
||||||
{
|
{
|
||||||
@@ -1024,11 +1029,17 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var lastPersonnelCodeByWorkshop = _personnelCodeRepository.GetLastPersonnelCodeByWorkshop(command.WorkshopId);
|
var insuranceLeftWork =
|
||||||
|
_leftWorkInsuranceRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id);
|
||||||
|
if (insuranceLeftWork == null)
|
||||||
|
{
|
||||||
|
var lastPersonnelCodeByWorkshop =
|
||||||
|
_personnelCodeRepository.GetLastPersonnelCodeByWorkshop(command.WorkshopId);
|
||||||
|
|
||||||
personnelCode = new PersonnelCodeDomain(command.WorkshopId,
|
personnelCode = new PersonnelCodeDomain(command.WorkshopId,
|
||||||
employee.id, lastPersonnelCodeByWorkshop + 1);
|
employee.id, lastPersonnelCodeByWorkshop + 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var leftWorkTemp = LeftWorkTemp.CreateStartWork(command.WorkshopId, employee.id, startLeftWork, command.JobId);
|
var leftWorkTemp = LeftWorkTemp.CreateStartWork(command.WorkshopId, employee.id, startLeftWork, command.JobId);
|
||||||
_leftWorkTempRepository.Create(leftWorkTemp);
|
_leftWorkTempRepository.Create(leftWorkTemp);
|
||||||
|
|||||||
@@ -191,6 +191,8 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
|||||||
return _rollCallEmployeeRepository.HasEmployees(workshopId);
|
return _rollCallEmployeeRepository.HasEmployees(workshopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
|
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
|
||||||
{
|
{
|
||||||
OperationResult result = new();
|
OperationResult result = new();
|
||||||
|
|||||||
@@ -134,5 +134,38 @@ namespace CompanyManagment.Application
|
|||||||
{
|
{
|
||||||
return _employeeRollCallStatusRepository.GetAll();
|
return _employeeRollCallStatusRepository.GetAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SyncRollCallEmployeeWithLeftWork(long rollCallEmployeeId)
|
||||||
|
{
|
||||||
|
var rollCallEmployee = _rollCallEmployeeRepository.GetWithRollCallStatus(rollCallEmployeeId);
|
||||||
|
if (rollCallEmployee == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var rollCallStatus = rollCallEmployee.EmployeesStatus.MaxBy(x => x.StartDate);
|
||||||
|
|
||||||
|
if (rollCallStatus == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var today = DateTime.Today;
|
||||||
|
|
||||||
|
var firstDayOfMonth = today.FindFirstDayOfMonthGr();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var employeeId = rollCallEmployee.EmployeeId;
|
||||||
|
var workshopId = rollCallEmployee.WorkshopId;
|
||||||
|
|
||||||
|
var leftWork = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(workshopId, employeeId);
|
||||||
|
|
||||||
|
if (leftWork == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var startWork = leftWork.StartWorkDate;
|
||||||
|
|
||||||
|
rollCallStatus.Edit(startWork < firstDayOfMonth ? firstDayOfMonth : startWork, rollCallStatus.EndDate);
|
||||||
|
|
||||||
|
_employeeRollCallStatusRepository.SaveChanges();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,6 +228,13 @@ public class CustomizeWorkshopEmployeeSettingsMapping : IEntityTypeConfiguration
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||||
|
{
|
||||||
|
offDay.HasKey(x => x.Id);
|
||||||
|
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||||
|
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||||
|
});
|
||||||
|
|
||||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,6 +227,14 @@ public class CustomizeWorkshopGroupSettingsMapping : IEntityTypeConfiguration<Cu
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||||
|
{
|
||||||
|
offDay.HasKey(x => x.Id);
|
||||||
|
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||||
|
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||||
|
});
|
||||||
|
|
||||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -221,6 +221,12 @@ public class CustomizeWorkshopSettingsMapping:IEntityTypeConfiguration<Customize
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||||
|
{
|
||||||
|
offDay.HasKey(x => x.Id);
|
||||||
|
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||||
|
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
builder.HasMany(x => x.CustomizeWorkshopGroupSettingsCollection).WithOne(x => x.CustomizeWorkshopSettings)
|
builder.HasMany(x => x.CustomizeWorkshopGroupSettingsCollection).WithOne(x => x.CustomizeWorkshopSettings)
|
||||||
|
|||||||
9744
CompanyManagment.EFCore/Migrations/20250602161025_add offDays to cws.Designer.cs
generated
Normal file
9744
CompanyManagment.EFCore/Migrations/20250602161025_add offDays to cws.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace CompanyManagment.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addoffDaystocws : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||||
|
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_CustomizeWorkshopEmployeeSettings_ParentId",
|
||||||
|
column: x => x.ParentId,
|
||||||
|
principalTable: "CustomizeWorkshopEmployeeSettings",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||||
|
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CustomizeWorkshopGroupSettings_WeeklyOffDays", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CustomizeWorkshopGroupSettings_WeeklyOffDays_CustomizeWorkshopGroupSettings_ParentId",
|
||||||
|
column: x => x.ParentId,
|
||||||
|
principalTable: "CustomizeWorkshopGroupSettings",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CustomizeWorkshopSettings_WeeklyOffDays",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||||
|
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CustomizeWorkshopSettings_WeeklyOffDays", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CustomizeWorkshopSettings_WeeklyOffDays_CustomizeWorkshopSettings_ParentId",
|
||||||
|
column: x => x.ParentId,
|
||||||
|
principalTable: "CustomizeWorkshopSettings",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_ParentId",
|
||||||
|
table: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
|
||||||
|
column: "ParentId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CustomizeWorkshopGroupSettings_WeeklyOffDays_ParentId",
|
||||||
|
table: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
|
||||||
|
column: "ParentId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CustomizeWorkshopSettings_WeeklyOffDays_ParentId",
|
||||||
|
table: "CustomizeWorkshopSettings_WeeklyOffDays",
|
||||||
|
column: "ParentId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CustomizeWorkshopSettings_WeeklyOffDays");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7433,6 +7433,32 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
.HasForeignKey("CustomizeWorkshopEmployeeSettingsid");
|
.HasForeignKey("CustomizeWorkshopEmployeeSettingsid");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||||
|
|
||||||
|
b1.Property<string>("DayOfWeek")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(15)
|
||||||
|
.HasColumnType("nvarchar(15)");
|
||||||
|
|
||||||
|
b1.Property<long>("ParentId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b1.HasKey("Id");
|
||||||
|
|
||||||
|
b1.HasIndex("ParentId");
|
||||||
|
|
||||||
|
b1.ToTable("CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("ParentId");
|
||||||
|
});
|
||||||
|
|
||||||
b.Navigation("BaseYearsPay");
|
b.Navigation("BaseYearsPay");
|
||||||
|
|
||||||
b.Navigation("BonusesPay");
|
b.Navigation("BonusesPay");
|
||||||
@@ -7468,6 +7494,8 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.Navigation("OverTimePay");
|
b.Navigation("OverTimePay");
|
||||||
|
|
||||||
b.Navigation("ShiftPay");
|
b.Navigation("ShiftPay");
|
||||||
|
|
||||||
|
b.Navigation("WeeklyOffDays");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b =>
|
modelBuilder.Entity("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b =>
|
||||||
@@ -7991,6 +8019,32 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
.HasForeignKey("CustomizeWorkshopGroupSettingsid");
|
.HasForeignKey("CustomizeWorkshopGroupSettingsid");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||||
|
|
||||||
|
b1.Property<string>("DayOfWeek")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(15)
|
||||||
|
.HasColumnType("nvarchar(15)");
|
||||||
|
|
||||||
|
b1.Property<long>("ParentId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b1.HasKey("Id");
|
||||||
|
|
||||||
|
b1.HasIndex("ParentId");
|
||||||
|
|
||||||
|
b1.ToTable("CustomizeWorkshopGroupSettings_WeeklyOffDays");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("ParentId");
|
||||||
|
});
|
||||||
|
|
||||||
b.Navigation("BaseYearsPay");
|
b.Navigation("BaseYearsPay");
|
||||||
|
|
||||||
b.Navigation("BonusesPay");
|
b.Navigation("BonusesPay");
|
||||||
@@ -8026,6 +8080,8 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.Navigation("OverTimePay");
|
b.Navigation("OverTimePay");
|
||||||
|
|
||||||
b.Navigation("ShiftPay");
|
b.Navigation("ShiftPay");
|
||||||
|
|
||||||
|
b.Navigation("WeeklyOffDays");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b =>
|
modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b =>
|
||||||
@@ -8476,6 +8532,32 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
.HasForeignKey("CustomizeWorkshopSettingsid");
|
.HasForeignKey("CustomizeWorkshopSettingsid");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||||
|
|
||||||
|
b1.Property<string>("DayOfWeek")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(15)
|
||||||
|
.HasColumnType("nvarchar(15)");
|
||||||
|
|
||||||
|
b1.Property<long>("ParentId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b1.HasKey("Id");
|
||||||
|
|
||||||
|
b1.HasIndex("ParentId");
|
||||||
|
|
||||||
|
b1.ToTable("CustomizeWorkshopSettings_WeeklyOffDays");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("ParentId");
|
||||||
|
});
|
||||||
|
|
||||||
b.Navigation("BaseYearsPay");
|
b.Navigation("BaseYearsPay");
|
||||||
|
|
||||||
b.Navigation("BonusesPay");
|
b.Navigation("BonusesPay");
|
||||||
@@ -8504,6 +8586,8 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
|
|
||||||
b.Navigation("ShiftPay");
|
b.Navigation("ShiftPay");
|
||||||
|
|
||||||
|
b.Navigation("WeeklyOffDays");
|
||||||
|
|
||||||
b.Navigation("Workshop");
|
b.Navigation("Workshop");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ using AccountMangement.Infrastructure.EFCore;
|
|||||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Tools = _0_Framework_b.Application.Tools;
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Repository;
|
namespace CompanyManagment.EFCore.Repository;
|
||||||
|
|
||||||
@@ -31,10 +33,14 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
var month = searchModel.Month;
|
var month = searchModel.Month;
|
||||||
var accountId = searchModel.AdminAccountId;
|
var accountId = searchModel.AdminAccountId;
|
||||||
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
||||||
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetDate) == false)
|
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetStartDate) == false)
|
||||||
return [];
|
return [];
|
||||||
|
var targetEndDate = Tools.FindeEndOfMonth(targetStartDate.ToFarsi()).ToGeorgianDateTime();
|
||||||
|
|
||||||
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextMonth);
|
|
||||||
|
|
||||||
|
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextFirstMonth);
|
||||||
|
var nextEndMonth = Tools.FindeEndOfMonth(nextFirstMonth.ToFarsi()).ToGeorgianDateTime();
|
||||||
|
|
||||||
|
|
||||||
// دریافت اطلاعات ادمین
|
// دریافت اطلاعات ادمین
|
||||||
@@ -46,7 +52,7 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
|
|
||||||
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
||||||
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
||||||
.Where(c => c.ContractStartGr <= targetDate && c.ContractEndGr >= targetDate)
|
.Where(c => c.ContractStartGr <= targetEndDate && c.ContractEndGr >= targetStartDate)
|
||||||
.Select(c => c.ContractingPartyId);
|
.Select(c => c.ContractingPartyId);
|
||||||
|
|
||||||
// دریافت کارگاههای مرتبط با اکانت
|
// دریافت کارگاههای مرتبط با اکانت
|
||||||
@@ -59,8 +65,8 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
|
|
||||||
|
|
||||||
var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
|
var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
|
||||||
((x.StartWorkDate <= targetDate && x.LeftWorkDate.AddDays(-1) >= targetDate)
|
((x.StartWorkDate <= targetEndDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate)
|
||||||
|| (x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
|
|| (x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -109,7 +115,7 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
||||||
|
|
||||||
// بهروزرسانی وضعیتها
|
// بهروزرسانی وضعیتها
|
||||||
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetDate, nextMonth);
|
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetStartDate,targetEndDate, nextFirstMonth,nextEndMonth);
|
||||||
|
|
||||||
if (searchModel.ActivationStatus != IsActive.None)
|
if (searchModel.ActivationStatus != IsActive.None)
|
||||||
{
|
{
|
||||||
@@ -137,11 +143,11 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
}
|
}
|
||||||
|
|
||||||
var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x =>
|
var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x =>
|
||||||
x.StartWorkDate <= targetDate && x.LeftWorkDate.AddDays(-1) >= targetDate && workshopIds.Contains(x.WorkshopId))
|
x.StartWorkDate <= targetStartDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||||
|
|
||||||
var employeeContractCounts = _companyContext.LeftWorkList.Where(x =>
|
var employeeContractCounts = _companyContext.LeftWorkList.Where(x =>
|
||||||
x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth && workshopIds.Contains(x.WorkshopId))
|
x.StartWorkDate <= nextFirstMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth && workshopIds.Contains(x.WorkshopId))
|
||||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||||
|
|
||||||
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
||||||
@@ -231,13 +237,12 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds, DateTime targetDate, DateTime nextMonth)
|
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds, DateTime targetStartDate,DateTime targetEndDate, DateTime nextStartMonth,DateTime nextEndMonth)
|
||||||
{
|
{
|
||||||
var vipGroup = _companyContext.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
var vipGroup = _companyContext.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
||||||
.Select(x => x.EmployeeId)
|
.Select(x => x.EmployeeId)
|
||||||
.Except([5976]).ToList();
|
.Except([5976]).ToList();
|
||||||
|
|
||||||
|
|
||||||
var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||||
.Join(
|
.Join(
|
||||||
_companyContext.Contracts.AsNoTracking(),
|
_companyContext.Contracts.AsNoTracking(),
|
||||||
@@ -247,28 +252,32 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
)
|
)
|
||||||
.Where(x =>
|
.Where(x =>
|
||||||
workshopIds.Contains(x.leftWork.WorkshopId) &&
|
workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||||
x.leftWork.StartWorkDate <= targetDate &&
|
x.leftWork.StartWorkDate <= targetEndDate &&
|
||||||
x.leftWork.LeftWorkDate.AddDays(-1) >= targetDate &&
|
x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||||
x.contract.ContarctStart <= targetDate &&
|
x.contract.ContarctStart <= targetEndDate &&
|
||||||
x.contract.ContractEnd >= targetDate
|
x.contract.ContractEnd >= targetStartDate &&
|
||||||
&& !vipGroup.Contains(x.leftWork.EmployeeId)
|
!vipGroup.Contains(x.leftWork.EmployeeId) &&
|
||||||
|
!_companyContext.EmployeeClientTemps
|
||||||
|
.Any(temp => temp.EmployeeId == x.leftWork.EmployeeId && temp.WorkshopId == x.leftWork.WorkshopId)
|
||||||
)
|
)
|
||||||
.Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
|
.Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
|
||||||
|
|
||||||
var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth
|
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextStartMonth &&
|
||||||
&& !vipGroup.Contains(x.EmployeeId))
|
!vipGroup.Contains(x.EmployeeId) &&
|
||||||
.Select(x => new { x.WorkshopId, x.EmployeeId });
|
!_companyContext.EmployeeClientTemps
|
||||||
|
.Any(temp => temp.EmployeeId == x.EmployeeId && temp.WorkshopId == x.WorkshopId)
|
||||||
|
).Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||||
|
|
||||||
var contractSet = (await _companyContext.Contracts.AsNoTracking()
|
var contractSet = (await _companyContext.Contracts.AsNoTracking()
|
||||||
.Where(x => x.ContarctStart <= nextMonth && x.ContractEnd >= nextMonth && workshopIds.Contains(x.WorkshopIds))
|
.Where(x => x.ContarctStart <= nextEndMonth && x.ContractEnd >= nextStartMonth && workshopIds.Contains(x.WorkshopIds))
|
||||||
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
||||||
.ToListAsync())
|
.ToListAsync())
|
||||||
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
||||||
.ToHashSet();
|
.ToHashSet();
|
||||||
|
|
||||||
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
||||||
.Where(x => x.ContractStart <= targetDate && x.ContractEnd >= targetDate && workshopIds.Contains(x.WorkshopId))
|
.Where(x => x.ContractStart <= targetEndDate && x.ContractEnd >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||||
.ToListAsync())
|
.ToListAsync())
|
||||||
.Select(x => (x.WorkshopId, x.EmployeeId))
|
.Select(x => (x.WorkshopId, x.EmployeeId))
|
||||||
@@ -287,6 +296,8 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
.Select(g => g.WorkshopId)
|
.Select(g => g.WorkshopId)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
var list = workingContractEmployeeIds.ToList().Where(x=>!contractSet.Any(a=>a.EmployeeId== x.EmployeeId&&a.WorkshopIds == x.WorkshopId)).ToList();
|
||||||
|
|
||||||
var workshopsWithFullCheckout = workingCheckoutGrouping
|
var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||||
.Select(g => g.Key)
|
.Select(g => g.Key)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
|
|||||||
return new();
|
return new();
|
||||||
return new EditCustomizeEmployeeSettings()
|
return new EditCustomizeEmployeeSettings()
|
||||||
{
|
{
|
||||||
FridayWork = entity.FridayWork,
|
|
||||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||||
LateToWork = new()
|
LateToWork = new()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
|
|||||||
var entity = _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().FirstOrDefault(x => x.id == groupId);
|
var entity = _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().FirstOrDefault(x => x.id == groupId);
|
||||||
return new EditCustomizeWorkshopGroupSettings()
|
return new EditCustomizeWorkshopGroupSettings()
|
||||||
{
|
{
|
||||||
FridayWork = entity.FridayWork,
|
//FridayWork = entity.FridayWork,
|
||||||
FridayPay = new (){ FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
FridayPay = new (){ FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||||
LateToWork = new()
|
LateToWork = new()
|
||||||
{
|
{
|
||||||
@@ -338,8 +338,8 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
|
|||||||
{
|
{
|
||||||
EndTime = x.EndTime.ToString("HH:mm"),
|
EndTime = x.EndTime.ToString("HH:mm"),
|
||||||
StartTime = x.StartTime.ToString("HH:mm")
|
StartTime = x.StartTime.ToString("HH:mm")
|
||||||
}).ToList()
|
}).ToList(),
|
||||||
|
OffDayOfWeeks = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
|||||||
return new();
|
return new();
|
||||||
var viewModel = new EditCustomizeWorkshopSettings()
|
var viewModel = new EditCustomizeWorkshopSettings()
|
||||||
{
|
{
|
||||||
FridayWork = entity.FridayWork,
|
|
||||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||||
LateToWork = new()
|
LateToWork = new()
|
||||||
{
|
{
|
||||||
@@ -234,7 +233,8 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
|||||||
LeavePermittedDays = entity.LeavePermittedDays,
|
LeavePermittedDays = entity.LeavePermittedDays,
|
||||||
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
|
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
|
||||||
WorkshopId = entity.WorkshopId,
|
WorkshopId = entity.WorkshopId,
|
||||||
WorkshopShiftStatus = entity.WorkshopShiftStatus
|
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||||
|
OffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
|
||||||
|
|
||||||
};
|
};
|
||||||
return viewModel;
|
return viewModel;
|
||||||
@@ -261,8 +261,8 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
|||||||
Id = entity.id,
|
Id = entity.id,
|
||||||
WorkshopId = entity.WorkshopId,
|
WorkshopId = entity.WorkshopId,
|
||||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||||
FridayWork = entity.FridayWork,
|
HolidayWork = entity.HolidayWork,
|
||||||
HolidayWork = entity.HolidayWork
|
OffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1173,7 +1173,17 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
|||||||
//RequiredDocuments = requiredDocs
|
//RequiredDocuments = requiredDocs
|
||||||
};
|
};
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
result.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
|
||||||
|
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
|
||||||
|
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
|
||||||
|
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
|
||||||
|
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
|
||||||
|
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
|
||||||
|
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
|
||||||
|
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
|
||||||
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1194,7 +1204,7 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
|||||||
.GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel()
|
.GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel()
|
||||||
{
|
{
|
||||||
WorkshopId = x.Key,
|
WorkshopId = x.Key,
|
||||||
WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopName,
|
WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopFullName,
|
||||||
EmployeesWithoutDocumentCount = x.Count()
|
EmployeesWithoutDocumentCount = x.Count()
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1301,6 +1311,18 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
|||||||
};
|
};
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
result.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
|
||||||
|
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
|
||||||
|
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
|
||||||
|
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
|
||||||
|
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
|
||||||
|
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
|
||||||
|
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
|
||||||
|
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
|
||||||
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1463,7 +1485,17 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
|||||||
//RequiredDocuments = requiredDocs
|
//RequiredDocuments = requiredDocs
|
||||||
};
|
};
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
result.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
|
||||||
|
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
|
||||||
|
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
|
||||||
|
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
|
||||||
|
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
|
||||||
|
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
|
||||||
|
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
|
||||||
|
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
|
||||||
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1568,7 +1600,17 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
|||||||
//RequiredDocuments = requiredDocs
|
//RequiredDocuments = requiredDocs
|
||||||
};
|
};
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
result.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
|
||||||
|
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
|
||||||
|
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
|
||||||
|
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
|
||||||
|
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
|
||||||
|
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
|
||||||
|
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
|
||||||
|
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
|
||||||
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1646,6 +1688,10 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string GetThumbnailPathFromFilePath(string filePath)
|
||||||
|
{
|
||||||
|
return string.IsNullOrWhiteSpace(filePath) ? string.Empty : Path.Combine(Path.GetDirectoryName(filePath)!, Path.GetFileNameWithoutExtension(filePath) + $"-thumbnail{Path.GetExtension(filePath)}");
|
||||||
|
}
|
||||||
|
|
||||||
private static EmployeeDocumentItemViewModel GetByLabelAndLoadMedia(List<EmployeeDocumentItemViewModel> items,
|
private static EmployeeDocumentItemViewModel GetByLabelAndLoadMedia(List<EmployeeDocumentItemViewModel> items,
|
||||||
List<MediaViewModel> medias, DocumentItemLabel label)
|
List<MediaViewModel> medias, DocumentItemLabel label)
|
||||||
|
|||||||
@@ -796,5 +796,11 @@ public class LeftWorkInsuranceRepository : RepositoryBase<long, LeftWorkInsuranc
|
|||||||
return insuranceLeftWorkWithContractExitOnly.ToList();
|
return insuranceLeftWorkWithContractExitOnly.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LeftWorkInsurance GetLastLeftWorkByEmployeeIdAndWorkshopId(long workshopId, long employeeId)
|
||||||
|
{
|
||||||
|
return _context.LeftWorkInsuranceList.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
|
||||||
|
.OrderByDescending(x => x.StartWorkDate).FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -654,6 +654,9 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
|||||||
var vipGroup = _context.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
var vipGroup = _context.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
||||||
.Select(x => x.EmployeeId)
|
.Select(x => x.EmployeeId)
|
||||||
.Except([5976]).ToList();
|
.Except([5976]).ToList();
|
||||||
|
var clientTemps = _context.EmployeeClientTemps.Where(x => x.WorkshopId == searchModel.WorkshopId)
|
||||||
|
.Select(x => x.EmployeeId);
|
||||||
|
|
||||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||||
{
|
{
|
||||||
Id = x.id,
|
Id = x.id,
|
||||||
@@ -672,7 +675,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
|||||||
JobName = _context.Jobs.FirstOrDefault(j => j.id == x.JobId).JobName
|
JobName = _context.Jobs.FirstOrDefault(j => j.id == x.JobId).JobName
|
||||||
|
|
||||||
|
|
||||||
}).Where(x=> !vipGroup.Contains(x.EmployeeId));
|
}).Where(x=> !vipGroup.Contains(x.EmployeeId) && !clientTemps.Contains(x.EmployeeId));
|
||||||
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
||||||
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
||||||
if (searchModel.EmployeeId != 0 && searchModel.WorkshopId == 0)
|
if (searchModel.EmployeeId != 0 && searchModel.WorkshopId == 0)
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ using CompanyManagment.App.Contracts.Reward.Enums;
|
|||||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||||
using Company.Domain.HolidayItemAgg;
|
using Company.Domain.HolidayItemAgg;
|
||||||
|
using Company.Domain.RollCallEmployeeAgg;
|
||||||
using PersianTools.Core;
|
using PersianTools.Core;
|
||||||
|
|
||||||
|
|
||||||
@@ -49,6 +50,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
|||||||
private readonly TestDbContext _testDbContext;
|
private readonly TestDbContext _testDbContext;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public RollCallMandatoryRepository(CompanyContext context, IYearlySalaryRepository yearlySalaryRepository,
|
public RollCallMandatoryRepository(CompanyContext context, IYearlySalaryRepository yearlySalaryRepository,
|
||||||
ILeftWorkRepository leftWorkRepository, ILeaveRepository leaveRepository, IHolidayItemRepository holidayItemRepository, TestDbContext testDbContext) : base(context)
|
ILeftWorkRepository leftWorkRepository, ILeaveRepository leaveRepository, IHolidayItemRepository holidayItemRepository, TestDbContext testDbContext) : base(context)
|
||||||
{
|
{
|
||||||
@@ -58,6 +60,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
|||||||
_leaveRepository = leaveRepository;
|
_leaveRepository = leaveRepository;
|
||||||
_holidayItemRepository = holidayItemRepository;
|
_holidayItemRepository = holidayItemRepository;
|
||||||
_testDbContext = testDbContext;
|
_testDbContext = testDbContext;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region OfficialChckout
|
#region OfficialChckout
|
||||||
@@ -724,6 +727,55 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="employeeId"></param>
|
||||||
|
/// <param name="workshopId"></param>
|
||||||
|
/// <param name="contractStart"></param>
|
||||||
|
/// <param name="contractEnd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
|
||||||
|
DateTime contractStart, DateTime contractEnd)
|
||||||
|
{
|
||||||
|
//bool hasRollcall =
|
||||||
|
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
|
||||||
|
//if (!hasRollcall)
|
||||||
|
// return (false, new TimeSpan());
|
||||||
|
List<RollCallViewModel> rollCallResult;
|
||||||
|
List<GroupedRollCalls> groupedRollCall;
|
||||||
|
|
||||||
|
|
||||||
|
rollCallResult = _context.RollCalls.Where(x =>
|
||||||
|
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
|
||||||
|
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
|
||||||
|
{
|
||||||
|
StartDate = x.StartDate,
|
||||||
|
EndDate = x.EndDate,
|
||||||
|
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
|
||||||
|
CreationDate = x.ShiftDate,
|
||||||
|
BreakTimeSpan = x.BreakTimeSpan
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||||
|
{
|
||||||
|
CreationDate = x.Key,
|
||||||
|
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||||
|
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||||
|
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||||
|
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||||
|
|
||||||
|
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||||
|
|
||||||
|
}).OrderBy(x => x.CreationDate).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
|
||||||
|
return (true, sumSpans);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
|
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
|
||||||
{
|
{
|
||||||
List<RollCallViewModel> rollCallResult = new List<RollCallViewModel>();
|
List<RollCallViewModel> rollCallResult = new List<RollCallViewModel>();
|
||||||
@@ -2263,6 +2315,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region CustomizeCheckout
|
#region CustomizeCheckout
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -8,10 +8,13 @@ using _0_Framework.Application;
|
|||||||
using _0_Framework.InfraStructure;
|
using _0_Framework.InfraStructure;
|
||||||
using Company.Domain.LeftWorkAgg;
|
using Company.Domain.LeftWorkAgg;
|
||||||
using Company.Domain.MandatoryHoursAgg;
|
using Company.Domain.MandatoryHoursAgg;
|
||||||
|
using Company.Domain.RollCallAgg;
|
||||||
|
using Company.Domain.RollCallEmployeeAgg;
|
||||||
using Company.Domain.YearlySalaryAgg;
|
using Company.Domain.YearlySalaryAgg;
|
||||||
using CompanyManagment.App.Contracts.Checkout;
|
using CompanyManagment.App.Contracts.Checkout;
|
||||||
using CompanyManagment.App.Contracts.Holiday;
|
using CompanyManagment.App.Contracts.Holiday;
|
||||||
using CompanyManagment.App.Contracts.LeftWork;
|
using CompanyManagment.App.Contracts.LeftWork;
|
||||||
|
using CompanyManagment.App.Contracts.RollCall;
|
||||||
using CompanyManagment.App.Contracts.YearlySalary;
|
using CompanyManagment.App.Contracts.YearlySalary;
|
||||||
using CompanyManagment.EFCore.Migrations;
|
using CompanyManagment.EFCore.Migrations;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
@@ -27,13 +30,16 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
|||||||
private readonly CompanyContext _context;
|
private readonly CompanyContext _context;
|
||||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||||
private readonly IMandatoryHoursRepository _mandatoryHoursRepository;
|
private readonly IMandatoryHoursRepository _mandatoryHoursRepository;
|
||||||
|
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||||
|
|
||||||
|
|
||||||
public YearlySalaryRepository(CompanyContext context, ILeftWorkRepository leftWorkRepository, IMandatoryHoursRepository mandatoryHoursRepository) : base(context)
|
|
||||||
|
public YearlySalaryRepository(CompanyContext context, ILeftWorkRepository leftWorkRepository, IMandatoryHoursRepository mandatoryHoursRepository, IRollCallEmployeeRepository rollCallEmployeeRepository) : base(context)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_leftWorkRepository = leftWorkRepository;
|
_leftWorkRepository = leftWorkRepository;
|
||||||
_mandatoryHoursRepository = mandatoryHoursRepository;
|
_mandatoryHoursRepository = mandatoryHoursRepository;
|
||||||
|
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||||
}
|
}
|
||||||
// لیست سال های برای دراپ دان
|
// لیست سال های برای دراپ دان
|
||||||
#region GetYearsToDropDown
|
#region GetYearsToDropDown
|
||||||
@@ -2229,7 +2235,56 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
private static TimeSpan CalculateBreakTime(TimeSpan breakTimeSpan, TimeSpan sumOneDaySpan)
|
||||||
|
{
|
||||||
|
if (breakTimeSpan * 2 >= sumOneDaySpan)
|
||||||
|
return new TimeSpan();
|
||||||
|
return breakTimeSpan; ;
|
||||||
|
}
|
||||||
|
|
||||||
|
private (bool hasRollCall, double WorkingTotalHours) GetTotalWorkingHoursIfHasRollCall(long employeeId,long workshopId, DateTime contractStart, DateTime contractEnd)
|
||||||
|
{
|
||||||
|
bool hasRollCall = _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId,
|
||||||
|
contractStart, contractEnd);
|
||||||
|
double totalWorkingHours = 0;
|
||||||
|
if (!hasRollCall)
|
||||||
|
return (false, 0);
|
||||||
|
|
||||||
|
List<RollCallViewModel> rollCallResult;
|
||||||
|
List<GroupedRollCalls> groupedRollCall;
|
||||||
|
|
||||||
|
|
||||||
|
rollCallResult = _context.RollCalls.Where(x =>
|
||||||
|
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart &&
|
||||||
|
x.StartDate.Value.Date <= contractEnd && x.EndDate != null).Select(x => new RollCallViewModel()
|
||||||
|
{
|
||||||
|
StartDate = x.StartDate,
|
||||||
|
EndDate = x.EndDate,
|
||||||
|
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
|
||||||
|
CreationDate = x.ShiftDate,
|
||||||
|
BreakTimeSpan = x.BreakTimeSpan
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||||
|
{
|
||||||
|
CreationDate = x.Key,
|
||||||
|
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||||
|
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||||
|
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||||
|
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}).OrderBy(x => x.CreationDate).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
|
||||||
|
totalWorkingHours = sumSpans.TotalMinutes / 60;
|
||||||
|
|
||||||
|
return (true, totalWorkingHours);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
public List<ContractsCanToLeave> LeftWorkCantoleaveList(DateTime startDate, DateTime endDate, long workshopId, long employeeId, bool hasleft, DateTime leftWorkDate, int fridayStartToEnd, int officialHoliday, string totalHoursH, string totalHorsM, DateTime separationStartDate)
|
public List<ContractsCanToLeave> LeftWorkCantoleaveList(DateTime startDate, DateTime endDate, long workshopId, long employeeId, bool hasleft, DateTime leftWorkDate, int fridayStartToEnd, int officialHoliday, string totalHoursH, string totalHorsM, DateTime separationStartDate)
|
||||||
{
|
{
|
||||||
// {مقدار ساعت مجاز مرخصی در برای یک روز{کامل
|
// {مقدار ساعت مجاز مرخصی در برای یک روز{کامل
|
||||||
@@ -2238,6 +2293,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
|||||||
var allContractsBetween = _context.Contracts.AsSplitQuery().Include(x => x.WorkingHoursList)
|
var allContractsBetween = _context.Contracts.AsSplitQuery().Include(x => x.WorkingHoursList)
|
||||||
.Where(x => x.WorkshopIds == workshopId && x.EmployeeId == employeeId &&
|
.Where(x => x.WorkshopIds == workshopId && x.EmployeeId == employeeId &&
|
||||||
x.ContractEnd >= startDate && x.ContarctStart <= endDate).ToList();
|
x.ContractEnd >= startDate && x.ContarctStart <= endDate).ToList();
|
||||||
|
|
||||||
int mandatoryDays = 0;
|
int mandatoryDays = 0;
|
||||||
double allCanToLeave = 0;
|
double allCanToLeave = 0;
|
||||||
double canToLeave = 0;
|
double canToLeave = 0;
|
||||||
@@ -2247,11 +2303,14 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
|||||||
contractCounter += 1;
|
contractCounter += 1;
|
||||||
var m = _mandatoryHoursRepository.GetMondatoryDays(contract.ContarctStart,
|
var m = _mandatoryHoursRepository.GetMondatoryDays(contract.ContarctStart,
|
||||||
contract.ContractEnd);
|
contract.ContractEnd);
|
||||||
|
|
||||||
var workinghoursH = contract.WorkingHoursList.Select(x => x.TotalHoursesH).FirstOrDefault();
|
var workinghoursH = contract.WorkingHoursList.Select(x => x.TotalHoursesH).FirstOrDefault();
|
||||||
var workinghoursM = contract.WorkingHoursList.Select(x => x.TotalHoursesM).FirstOrDefault();
|
var workinghoursM = contract.WorkingHoursList.Select(x => x.TotalHoursesM).FirstOrDefault();
|
||||||
workinghoursM = string.IsNullOrWhiteSpace(workinghoursM) ? "0" : workinghoursM;
|
workinghoursM = string.IsNullOrWhiteSpace(workinghoursM) ? "0" : workinghoursM;
|
||||||
var workingHoursHDouble = Convert.ToDouble(workinghoursH);
|
var workingHoursHDouble = Convert.ToDouble(workinghoursH);
|
||||||
var workingHoursMDouble = Convert.ToDouble(workinghoursM);
|
var workingHoursMDouble = Convert.ToDouble(workinghoursM);
|
||||||
|
|
||||||
|
|
||||||
if (workingHoursMDouble > 0)
|
if (workingHoursMDouble > 0)
|
||||||
{
|
{
|
||||||
//تبیدل دقیه به اعشار
|
//تبیدل دقیه به اعشار
|
||||||
@@ -2259,6 +2318,22 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
|||||||
}
|
}
|
||||||
//کل ساعت کار پرسنل در این ماه
|
//کل ساعت کار پرسنل در این ماه
|
||||||
var totalWorkingHours = workingHoursHDouble + workingHoursMDouble;
|
var totalWorkingHours = workingHoursHDouble + workingHoursMDouble;
|
||||||
|
|
||||||
|
#region RollCallSpan
|
||||||
|
|
||||||
|
var contractTotallDays = Convert.ToInt32((contract.ContractEnd - contract.ContarctStart).TotalDays + 1);
|
||||||
|
if (contractTotallDays <= 31)
|
||||||
|
{
|
||||||
|
|
||||||
|
var rollCallTotalHoures = GetTotalWorkingHoursIfHasRollCall(employeeId, workshopId,
|
||||||
|
contract.ContarctStart.Date, contract.ContractEnd.Date);
|
||||||
|
if (rollCallTotalHoures.hasRollCall)
|
||||||
|
{
|
||||||
|
totalWorkingHours = rollCallTotalHoures.WorkingTotalHours;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
// میانگین ساعت کارکرد پرسنل در روز
|
// میانگین ساعت کارکرد پرسنل در روز
|
||||||
var workingHoursePerDay = totalWorkingHours / m.MoandatoryDays;
|
var workingHoursePerDay = totalWorkingHours / m.MoandatoryDays;
|
||||||
|
|
||||||
@@ -2753,6 +2828,22 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
|||||||
}
|
}
|
||||||
//کل ساعت کار پرسنل در این قرارداد
|
//کل ساعت کار پرسنل در این قرارداد
|
||||||
var totalWorkingHours = workingHoursHDouble + workingHoursMDouble;
|
var totalWorkingHours = workingHoursHDouble + workingHoursMDouble;
|
||||||
|
|
||||||
|
#region RollCallSpan
|
||||||
|
|
||||||
|
var contractTotallDays = Convert.ToInt32((contract.ContractEnd - contract.ContarctStart).TotalDays + 1);
|
||||||
|
if (contractTotallDays <= 31)
|
||||||
|
{
|
||||||
|
|
||||||
|
var rollCallTotalHoures = GetTotalWorkingHoursIfHasRollCall(employeeId, workshopId,
|
||||||
|
contract.ContarctStart.Date, contract.ContractEnd.Date);
|
||||||
|
if (rollCallTotalHoures.hasRollCall)
|
||||||
|
{
|
||||||
|
totalWorkingHours = rollCallTotalHoures.WorkingTotalHours;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
// میانگین ساعت کارکرد پرسنل در روز
|
// میانگین ساعت کارکرد پرسنل در روز
|
||||||
var workingHoursePerDay = totalWorkingHours / m.MoandatoryDays;
|
var workingHoursePerDay = totalWorkingHours / m.MoandatoryDays;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,10 @@
|
|||||||
margin-right: 80px;
|
margin-right: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.level4 {
|
||||||
|
margin-right: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
.parent {
|
.parent {
|
||||||
border-radius: 10px 0px 0px 10px;
|
border-radius: 10px 0px 0px 10px;
|
||||||
min-width: 220px;
|
min-width: 220px;
|
||||||
@@ -42,6 +46,16 @@
|
|||||||
border: 1px solid #666666 !important;
|
border: 1px solid #666666 !important;
|
||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.parentLevel3 {
|
||||||
|
border-radius: 10px 0px 0px 10px;
|
||||||
|
min-width: 220px !important;
|
||||||
|
text-align: start;
|
||||||
|
background-color: #666666 !important;
|
||||||
|
border: 1px solid #666666 !important;
|
||||||
|
margin-right: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
.ion-plus {
|
.ion-plus {
|
||||||
position: relative !important;
|
position: relative !important;
|
||||||
top: 4px !important;
|
top: 4px !important;
|
||||||
@@ -537,14 +551,44 @@
|
|||||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||||
</label>
|
</label>
|
||||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
||||||
</div>
|
@*لیست کاربران کلاینت*@
|
||||||
@* تشخیص چهره *@
|
<div class="child-check level3">
|
||||||
<div class="child-check level2">
|
|
||||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||||
</label>
|
</label>
|
||||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> <span style="bottom: 2px;position: relative"> تشخیص چهره </span> </label>
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel3"><input type="checkbox" disabled="disabled" value="30603" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست کاربران کلاینت </span> </label>
|
||||||
|
|
||||||
|
<div class="child-check level4">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060301" class="check-btn"> <span style="bottom: 2px;position: relative"> ورود به کلاینت </span> </label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="child-check level4">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060302" class="check-btn"> <span style="bottom: 2px;position: relative"> تغییر رمز </span> </label>
|
||||||
|
</div>
|
||||||
|
<div class="child-check level4">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060303" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||||
|
</div>
|
||||||
|
<div class="child-check level4">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060304" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="child-check level3">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30601" class="check-btn"> <span style="bottom: 2px;position: relative"> ایجادکاربر جدید </span> </label>
|
||||||
|
</div>
|
||||||
|
<div class="child-check level3">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30602" class="check-btn"> <span style="bottom: 2px;position: relative"> ایجاد نقش جدید </span> </label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="child-check level3">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30604" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست کاربران ادمین </span> </label>
|
||||||
|
</div>
|
||||||
|
<div class="child-check level3">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30605" class="check-btn"> <span style="bottom: 2px;position: relative"> نقش ها </span> </label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@* گزارشات *@
|
@* گزارشات *@
|
||||||
<div class="child-check level2">
|
<div class="child-check level2">
|
||||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||||
|
|||||||
@@ -18,6 +18,11 @@
|
|||||||
margin-right: 80px;
|
margin-right: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.level4 {
|
||||||
|
margin-right: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.parent {
|
.parent {
|
||||||
border-radius: 10px 0px 0px 10px;
|
border-radius: 10px 0px 0px 10px;
|
||||||
min-width: 220px;
|
min-width: 220px;
|
||||||
@@ -42,6 +47,15 @@
|
|||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.parentLevel3 {
|
||||||
|
border-radius: 10px 0px 0px 10px;
|
||||||
|
min-width: 220px !important;
|
||||||
|
text-align: start;
|
||||||
|
background-color: #666666 !important;
|
||||||
|
border: 1px solid #666666 !important;
|
||||||
|
margin-right: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
.ion-plus {
|
.ion-plus {
|
||||||
position: relative !important;
|
position: relative !important;
|
||||||
top: 4px !important;
|
top: 4px !important;
|
||||||
@@ -478,6 +492,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@*حضورغیاب*@
|
||||||
|
<div class="child-check level2">
|
||||||
|
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||||
|
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||||
|
</label>
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> <span style="bottom: 2px;position: relative"> حضورغیاب </span> </label>
|
||||||
|
|
||||||
|
</div>
|
||||||
@*ایجاد عناوین مقادیر سالانه*@
|
@*ایجاد عناوین مقادیر سالانه*@
|
||||||
<div class="child-check level2">
|
<div class="child-check level2">
|
||||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||||
@@ -540,14 +562,44 @@
|
|||||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||||
</label>
|
</label>
|
||||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
||||||
</div>
|
@*لیست کاربران کلاینت*@
|
||||||
@* تشخیص چهره *@
|
<div class="child-check level3">
|
||||||
<div class="child-check level2">
|
|
||||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||||
</label>
|
</label>
|
||||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> <span style="bottom: 2px;position: relative"> تشخیص چهره </span> </label>
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel3"><input type="checkbox" disabled="disabled" value="30603" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست کاربران کلاینت </span> </label>
|
||||||
|
|
||||||
|
<div class="child-check level4">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060301" class="check-btn"> <span style="bottom: 2px;position: relative"> ورود به کلاینت </span> </label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="child-check level4">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060302" class="check-btn"> <span style="bottom: 2px;position: relative"> تغییر رمز </span> </label>
|
||||||
|
</div>
|
||||||
|
<div class="child-check level4">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060303" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||||
|
</div>
|
||||||
|
<div class="child-check level4">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060304" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="child-check level3">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30601" class="check-btn"> <span style="bottom: 2px;position: relative"> ایجادکاربر جدید </span> </label>
|
||||||
|
</div>
|
||||||
|
<div class="child-check level3">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30602" class="check-btn"> <span style="bottom: 2px;position: relative"> ایجاد نقش جدید </span> </label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="child-check level3">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30604" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست کاربران ادمین </span> </label>
|
||||||
|
</div>
|
||||||
|
<div class="child-check level3">
|
||||||
|
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30605" class="check-btn"> <span style="bottom: 2px;position: relative"> نقش ها </span> </label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@* گزارشات *@
|
@* گزارشات *@
|
||||||
<div class="child-check level2">
|
<div class="child-check level2">
|
||||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||||
|
|||||||
@@ -3,12 +3,14 @@
|
|||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using _0_Framework.Application
|
@using _0_Framework.Application
|
||||||
@model ServiceHost.Areas.Admin.Pages.Accounts.Account.IndexModel
|
@model ServiceHost.Areas.Admin.Pages.Accounts.Account.IndexModel
|
||||||
|
@inject IAuthHelper _AuthHelper;
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
|
||||||
var i = 1;
|
var i = 1;
|
||||||
var j = 1;
|
var j = 1;
|
||||||
var r = 1;
|
var r = 1;
|
||||||
|
var permissionList = _AuthHelper.GetPermissions();
|
||||||
//string colaps = "in";
|
//string colaps = "in";
|
||||||
//string act = "active";
|
//string act = "active";
|
||||||
}
|
}
|
||||||
@@ -64,11 +66,11 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<p class="pull-right">
|
<p class="pull-right" permission="30601">
|
||||||
<a href="#showmodal=@Url.Page("./Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; border-top-left-radius: 0px; border-bottom-left-radius: 0px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد کاربر جدید</a>
|
<a href="#showmodal=@Url.Page("./Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; border-top-left-radius: 0px; border-bottom-left-radius: 0px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد کاربر جدید</a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
<p class="pull-right">
|
<p class="pull-right" permission="30602">
|
||||||
<a href="#showmodal=@Url.Page("./Index", "CreateRole")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #605f5f; font-family: 'Web_Yekan' !important; color: #605f5f !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px "> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #605f5f !important "></i> ایجاد نقش جدید</a>
|
<a href="#showmodal=@Url.Page("./Index", "CreateRole")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #605f5f; font-family: 'Web_Yekan' !important; color: #605f5f !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px "> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #605f5f !important "></i> ایجاد نقش جدید</a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
@@ -99,7 +101,7 @@
|
|||||||
|
|
||||||
<ul class="nav nav-tabs tabs" id="myTab">
|
<ul class="nav nav-tabs tabs" id="myTab">
|
||||||
@* ============================================RolesTab=================*@
|
@* ============================================RolesTab=================*@
|
||||||
<li class="tab">
|
<li class="tab @(permissionList.All(x => x != 30604) && permissionList.All(x => x != 30603)? "active" : "") " permission="30605">
|
||||||
<a href="#profile-21" data-toggle="tab" aria-expanded="false" class=" ac">
|
<a href="#profile-21" data-toggle="tab" aria-expanded="false" class=" ac">
|
||||||
<span class="visible-xs">
|
<span class="visible-xs">
|
||||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||||
@@ -109,7 +111,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@* ===============================================AdminTab=================*@
|
@* ===============================================AdminTab=================*@
|
||||||
<li class="tab active">
|
<li class="tab active" permission="30604">
|
||||||
<a href="#home-21" data-toggle="tab" aria-expanded="false" class="active ac">
|
<a href="#home-21" data-toggle="tab" aria-expanded="false" class="active ac">
|
||||||
<span class="visible-xs">
|
<span class="visible-xs">
|
||||||
<i class="fa fa-user" style="display: block;padding: 20px 0 0 0;"></i>
|
<i class="fa fa-user" style="display: block;padding: 20px 0 0 0;"></i>
|
||||||
@@ -119,20 +121,21 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@* ===============================================ClientTab=================*@
|
@* ===============================================ClientTab=================*@
|
||||||
<li class="tab">
|
<li class="tab @(permissionList.All(x => x != 30604) ? "active" : "")" permission="30603">
|
||||||
<a href="#Client-21" data-toggle="tab" aria-expanded="false" class=" ac">
|
<a href="#Client-21" data-toggle="tab" aria-expanded="false" class=" ac">
|
||||||
<span class="visible-xs" >
|
<span class="visible-xs" >
|
||||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||||
<span class="textMenu">لیست موازی</span>
|
<span class="textMenu">لیست کلاینت</span>
|
||||||
</span>
|
</span>
|
||||||
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> لیست کاربران ( موازی) (@Model.ClientAccounts.Count) </h3>
|
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> لیست کاربران ( کلاینت) (@Model.ClientAccounts.Count) </h3>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
@*==================================================================Adminusers=====*@
|
@*==================================================================Adminusers=====*@
|
||||||
<div class="tab-pane active" id="home-21">
|
<div class="tab-pane active" id="home-21" permission="30604">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@@ -298,7 +301,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@*==================================================================roles=====*@
|
@*==================================================================roles=====*@
|
||||||
<div class="tab-pane" id="profile-21">
|
<div class="tab-pane @(permissionList.All(x => x != 30604) && permissionList.All(x => x != 30603)? "active" : "") " id="profile-21" permission="30605">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -367,7 +370,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@*==================================================================Clientusers=====*@
|
@*==================================================================Clientusers=====*@
|
||||||
<div class="tab-pane" id="Client-21">
|
<div class="tab-pane @(permissionList.All(x => x != 30604) ? "active" : "")" id="Client-21" permission="30603">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@@ -485,27 +488,27 @@
|
|||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-success pull-right m-rl-5 red" onclick="directLogin(@item.Id)">
|
<a permission="3060301" class="btn btn-success pull-right m-rl-5 red" onclick="directLogin(@item.Id)">
|
||||||
<i class="fa fa-sign-in faSize"></i><span style="position: relative;bottom: 3px;">ورود به کلاینت</span>
|
<i class="fa fa-sign-in faSize"></i><span style="position: relative;bottom: 3px;">ورود به کلاینت</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-info pull-right m-rl-5 red"
|
<a permission="3060302" class="btn btn-info pull-right m-rl-5 red"
|
||||||
href="#showmodal=@Url.Page("./Index", "ChangePassword", new { item.Id })">
|
href="#showmodal=@Url.Page("./Index", "ChangePassword", new { item.Id })">
|
||||||
<i class="fa fa-key faSize"></i>
|
<i class="fa fa-key faSize"></i>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-warning pull-right m-rl-5 red"
|
<a permission="3060303" class="btn btn-warning pull-right m-rl-5 red"
|
||||||
href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })">
|
href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })">
|
||||||
<i class="fa fa-edit faSize"></i>
|
<i class="fa fa-edit faSize"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@if (item.IsActiveString == "true" && item.Role != "مدیر سیستم")
|
@if (item.IsActiveString == "true" && item.Role != "مدیر سیستم")
|
||||||
{
|
{
|
||||||
<a onclick="deActive(@item.Id, '@item.Fullname')" class="btn btn-danger pull-right m-rl-5 red">
|
<a permission="3060304" onclick="deActive(@item.Id, '@item.Fullname')" class="btn btn-danger pull-right m-rl-5 red">
|
||||||
<i class="fa faSize fa-trash"></i>
|
<i class="fa faSize fa-trash"></i>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
else if (item.IsActiveString == "false")
|
else if (item.IsActiveString == "false")
|
||||||
{
|
{
|
||||||
<a onclick="Active(@item.Id, '@item.Fullname')" class=" btn btn-success pull-right m-rl-5 red">
|
<a permission="3060304" onclick="Active(@item.Id, '@item.Fullname')" class=" btn btn-success pull-right m-rl-5 red">
|
||||||
<i class="fa faSize fa-rotate-left"></i>
|
<i class="fa faSize fa-rotate-left"></i>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1483,8 +1483,8 @@ public class IndexModel : PageModel
|
|||||||
return Partial("../Error/_ErrorModal", resultError);
|
return Partial("../Error/_ErrorModal", resultError);
|
||||||
}
|
}
|
||||||
|
|
||||||
var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
|
//var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) || clientTemps.Any())
|
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) /*|| clientTemps.Any()*/)
|
||||||
{
|
{
|
||||||
var resultError = new ErrorViewModel()
|
var resultError = new ErrorViewModel()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
var accountId = AuthHelper.CurrentAccountId();
|
||||||
|
|
||||||
}
|
}
|
||||||
<div class="left side-menu">
|
<div class="left side-menu">
|
||||||
<div class="sidebar-inner slimscrollleft">
|
<div class="sidebar-inner slimscrollleft">
|
||||||
@@ -177,19 +179,24 @@
|
|||||||
</svg>
|
</svg>
|
||||||
حضورغیاب </a>
|
حضورغیاب </a>
|
||||||
</li>
|
</li>
|
||||||
<li permission="306">
|
@if (accountId is 2 or 3)
|
||||||
|
{
|
||||||
|
<li permission="307">
|
||||||
<a class="clik3" href="/AdminNew/Company/Bank">
|
<a class="clik3" href="/AdminNew/Company/Bank">
|
||||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||||
</svg>
|
</svg>
|
||||||
بانک ها </a>
|
بانک ها </a>
|
||||||
</li>
|
</li>
|
||||||
<li permission="306"><a class="clik3" asp-page="/Company/SmsResult/Index">
|
<li permission="307">
|
||||||
|
<a class="clik3" asp-page="/Company/SmsResult/Index">
|
||||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||||
</svg>
|
</svg>
|
||||||
گزارش پیامک خودکار</a>
|
گزارش پیامک خودکار</a>
|
||||||
</li>
|
</li>
|
||||||
|
}
|
||||||
|
|
||||||
<li permission="301"><a class="clik3" asp-page="/Company/YearlySalaryTitles/Index">
|
<li permission="301"><a class="clik3" asp-page="/Company/YearlySalaryTitles/Index">
|
||||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, long workshopId,FridayWork fridayWork,HolidayWork holidayWork)
|
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, long workshopId,FridayWork fridayWork,HolidayWork holidayWork,List<DayOfWeek> offDayOfWeeks)
|
||||||
{
|
{
|
||||||
if (workshopId < 1)
|
if (workshopId < 1)
|
||||||
return new JsonResult(new
|
return new JsonResult(new
|
||||||
@@ -240,7 +240,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
|
|||||||
//Todo:Vafa!!
|
//Todo:Vafa!!
|
||||||
//Todo: Vafa : to in ja bool replaceChange group ro ezafe kon. hatman ham workshopShiftStatus az front pas bede be in.
|
//Todo: Vafa : to in ja bool replaceChange group ro ezafe kon. hatman ham workshopShiftStatus az front pas bede be in.
|
||||||
var result = _customizeWorkshopSettingsApplication
|
var result = _customizeWorkshopSettingsApplication
|
||||||
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, fridayWork, holidayWork);
|
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, holidayWork, offDayOfWeeks);
|
||||||
|
|
||||||
return new JsonResult(new
|
return new JsonResult(new
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@inject ITicketAccessAccountRepository TicketAccessAccount;
|
@inject ITicketAccessAccountRepository TicketAccessAccount;
|
||||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||||
@{
|
@{
|
||||||
|
var accountId = AuthHelper.CurrentAccountId();
|
||||||
<style>
|
<style>
|
||||||
.showCount span {
|
.showCount span {
|
||||||
background-color: #dd2a2a;
|
background-color: #dd2a2a;
|
||||||
@@ -241,14 +241,16 @@
|
|||||||
</svg>
|
</svg>
|
||||||
حضورغیاب </a>
|
حضورغیاب </a>
|
||||||
</li>
|
</li>
|
||||||
<li permission="306">
|
@if (accountId is 2 or 3)
|
||||||
|
{
|
||||||
|
<li permission="307">
|
||||||
<a class="clik3" href="/AdminNew/Company/Bank">
|
<a class="clik3" href="/AdminNew/Company/Bank">
|
||||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||||
</svg>
|
</svg>
|
||||||
بانک ها </a>
|
بانک ها </a>
|
||||||
</li>
|
</li>
|
||||||
<li permission="306">
|
<li permission="307">
|
||||||
<a class="clik3" asp-area="Admin" asp-page="/Company/SmsResult/Index">
|
<a class="clik3" asp-area="Admin" asp-page="/Company/SmsResult/Index">
|
||||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
|
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
|
||||||
@@ -256,6 +258,8 @@
|
|||||||
گزارش پیامک خودکار
|
گزارش پیامک خودکار
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
}
|
||||||
|
|
||||||
<li permission="301">
|
<li permission="301">
|
||||||
<a class="clik3" asp-area="Admin" asp-page="/Company/YearlySalaryTitles/Index">
|
<a class="clik3" asp-area="Admin" asp-page="/Company/YearlySalaryTitles/Index">
|
||||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||||
|
|||||||
@@ -58,14 +58,14 @@
|
|||||||
|
|
||||||
<div class="col-12 group-container">
|
<div class="col-12 group-container">
|
||||||
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
|
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
|
||||||
<div class="form-group my-1 group">
|
@* <div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group my-1 group">
|
<div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|||||||
@@ -56,14 +56,14 @@
|
|||||||
|
|
||||||
<div class="col-12 group-container">
|
<div class="col-12 group-container">
|
||||||
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
|
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
|
||||||
<div class="form-group my-1 group">
|
@* <div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group my-1 group">
|
<div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|||||||
@@ -29,14 +29,14 @@
|
|||||||
|
|
||||||
<div class="col-12 group-container">
|
<div class="col-12 group-container">
|
||||||
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
|
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
|
||||||
<div class="form-group my-1 group">
|
@* <div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group my-1 group">
|
<div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
@page
|
@page
|
||||||
|
@using _0_Framework.Application
|
||||||
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts.IndexModel
|
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts.IndexModel
|
||||||
|
@inject _0_Framework.Application.IAuthHelper authHelper
|
||||||
@{
|
@{
|
||||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||||
ViewData["Title"] = " - " + "تنظیمات حساب کاربری دوربین";
|
ViewData["Title"] = " - " + "تنظیمات حساب کاربری دوربین";
|
||||||
@@ -207,6 +209,9 @@
|
|||||||
// check and show modal Camera Account And Workshop Setting
|
// check and show modal Camera Account And Workshop Setting
|
||||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./../Index", "StatusCameraAccountAndWorkshopSetting")`;
|
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./../Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||||
var modalCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
|
var modalCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
|
||||||
|
|
||||||
|
var hasActiveDeActvePersmission = @(authHelper.GetPermissions().Contains(SubAccountPermissionHelper.CameraAccountActivationBtnPermissionCode) ? "true" : "false");
|
||||||
|
var hasEditCameraAccountPermission = @(authHelper.GetPermissions().Contains(SubAccountPermissionHelper.CameraAccountEditPermissionCode) ? "true" : "false");
|
||||||
</script>
|
</script>
|
||||||
<script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script>
|
<script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script>
|
||||||
}
|
}
|
||||||
@@ -360,6 +360,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
|||||||
message = createRollCallEmployeeStatus.Message,
|
message = createRollCallEmployeeStatus.Message,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
_rollCallEmployeeStatusApplication.SyncRollCallEmployeeWithLeftWork(result.SendId);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -240,9 +240,10 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
|||||||
BreakTime = employee.BreakTime,
|
BreakTime = employee.BreakTime,
|
||||||
WorkshopShiftStatus = employee.WorkshopShiftStatus,
|
WorkshopShiftStatus = employee.WorkshopShiftStatus,
|
||||||
IrregularShift = employee.IrregularShift,
|
IrregularShift = employee.IrregularShift,
|
||||||
FridayWork = employee.FridayWork,
|
//FridayWork = employee.FridayWork,
|
||||||
HolidayWork = employee.HolidayWork,
|
HolidayWork = employee.HolidayWork,
|
||||||
CustomizeRotatingShifts = employee.CustomizeRotatingShiftsViewModels
|
CustomizeRotatingShifts = employee.CustomizeRotatingShiftsViewModels,
|
||||||
|
WeeklyOffDays = employee.WeeklyOffDays
|
||||||
};
|
};
|
||||||
return Partial("ModalEditEmployeeFromGroup", command);
|
return Partial("ModalEditEmployeeFromGroup", command);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
|
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork,List<DayOfWeek> offDayOfWeeks)
|
||||||
{
|
{
|
||||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||||
@@ -324,7 +324,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
|||||||
//Todo:Vafa!!
|
//Todo:Vafa!!
|
||||||
//Todo: Vafa : to in ja bool replaceChange group ro ezafe kon. hatman ham workshopShiftStatus az front pas bede be in.
|
//Todo: Vafa : to in ja bool replaceChange group ro ezafe kon. hatman ham workshopShiftStatus az front pas bede be in.
|
||||||
var result = _customizeWorkshopSettingsApplication
|
var result = _customizeWorkshopSettingsApplication
|
||||||
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus,fridayWork, holidayWork);
|
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, holidayWork, offDayOfWeeks);
|
||||||
|
|
||||||
return new JsonResult(new
|
return new JsonResult(new
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -230,14 +230,14 @@
|
|||||||
<div class="col-6 p-0">
|
<div class="col-6 p-0">
|
||||||
<div class="group-container">
|
<div class="group-container">
|
||||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||||
<div class="d-flex form-group my-1 group">
|
@* <div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
|
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
|
||||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex form-group my-1 group">
|
<div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
|
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
|
||||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -389,14 +389,14 @@
|
|||||||
<div class="col-6 p-0">
|
<div class="col-6 p-0">
|
||||||
<div class="group-container">
|
<div class="group-container">
|
||||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||||
<div class="d-flex form-group my-1 group">
|
@* <div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex form-group my-1 group">
|
<div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -400,14 +400,14 @@
|
|||||||
<div class="col-6 p-0">
|
<div class="col-6 p-0">
|
||||||
<div class="group-container">
|
<div class="group-container">
|
||||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||||
<div class="d-flex form-group my-1 group">
|
@* <div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex form-group my-1 group">
|
<div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -162,14 +162,14 @@
|
|||||||
<div class="col-6 p-0">
|
<div class="col-6 p-0">
|
||||||
<div class="group-container">
|
<div class="group-container">
|
||||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||||
<div class="d-flex form-group my-1 group">
|
@* <div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
|
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
|
||||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex form-group my-1 group">
|
<div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
|
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
|
||||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall._WorkshopSetting
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork)
|
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork,List<DayOfWeek> offDayOfWeeks)
|
||||||
{
|
{
|
||||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||||
@@ -115,7 +115,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall._WorkshopSetting
|
|||||||
});
|
});
|
||||||
|
|
||||||
var result = _customizeWorkshopSettingsApplication
|
var result = _customizeWorkshopSettingsApplication
|
||||||
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, fridayWork, holidayWork);
|
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, holidayWork, offDayOfWeeks);
|
||||||
|
|
||||||
return new JsonResult(new
|
return new JsonResult(new
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -98,14 +98,14 @@
|
|||||||
<div class="col-6 p-0">
|
<div class="col-6 p-0">
|
||||||
<div class="group-container">
|
<div class="group-container">
|
||||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||||
<div class="d-flex form-group my-1 group">
|
@* <div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex form-group my-1 group">
|
<div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -162,14 +162,14 @@
|
|||||||
<div class="col-6 p-0">
|
<div class="col-6 p-0">
|
||||||
<div class="group-container">
|
<div class="group-container">
|
||||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||||
<div class="d-flex form-group my-1 group">
|
@* <div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
|
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
|
||||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex form-group my-1 group">
|
<div class="d-flex form-group my-1 group">
|
||||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
|
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
|
||||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 group-container">
|
<div class="col-12 group-container">
|
||||||
<div class="titleSettingRollCall">تعطیلات جمعه</div>
|
<div class="titleSettingRollCall">تعطیلات جمعه</div>
|
||||||
<div class="form-group my-1 group">
|
@* <div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group my-1 group">
|
<div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 group-container">
|
<div class="col-12 group-container">
|
||||||
<div class="titleSettingRollCall">تعطیلات جمعه</div>
|
<div class="titleSettingRollCall">تعطیلات جمعه</div>
|
||||||
<div class="form-group my-1 group">
|
@* <div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group my-1 group">
|
<div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|||||||
@@ -14,14 +14,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 group-container">
|
<div class="col-12 group-container">
|
||||||
<div class="titleSettingRollCall">تعطیلات جمعه</div>
|
<div class="titleSettingRollCall">تعطیلات جمعه</div>
|
||||||
<div class="form-group my-1 group">
|
@* <div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||||
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
<label for="Friday1">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group my-1 group">
|
<div class="form-group my-1 group">
|
||||||
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||||
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
<label for="Friday2">پرسنل در روزهای جمعه کار میکند.</label>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||||
using CompanyManagment.EFCore;
|
using CompanyManagment.EFCore;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ServiceHost.Areas.AdminNew.Pages.Company.RollCall;
|
using ServiceHost.Areas.AdminNew.Pages.Company.RollCall;
|
||||||
|
|
||||||
namespace ServiceHost.Test;
|
namespace ServiceHost.Test;
|
||||||
@@ -19,8 +21,37 @@ public class Tester
|
|||||||
{
|
{
|
||||||
|
|
||||||
// await AdminMonthlyOverviewTest();
|
// await AdminMonthlyOverviewTest();
|
||||||
|
//await ChangeFridayWorkToWeeklyDayOfWeek();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task ChangeFridayWorkToWeeklyDayOfWeek()
|
||||||
|
{
|
||||||
|
var employeeSettingsEnumerable =await _companyContext.CustomizeWorkshopEmployeeSettings.Where(x=>x.FridayWork ==FridayWork.Default).ToListAsync();
|
||||||
|
foreach (var employeeSetting in employeeSettingsEnumerable)
|
||||||
|
{
|
||||||
|
employeeSetting.FridayWorkToWeeklyDayOfWeek();
|
||||||
|
}
|
||||||
|
|
||||||
|
var groupSettings = await _companyContext.CustomizeWorkshopGroupSettings
|
||||||
|
.Where(x => x.FridayWork == FridayWork.Default).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var groupSetting in groupSettings)
|
||||||
|
{
|
||||||
|
groupSetting.FridayWorkToWeeklyDayOfWeek();
|
||||||
|
}
|
||||||
|
|
||||||
|
var workshopSettings = await _companyContext.CustomizeWorkshopSettings
|
||||||
|
.Where(x => x.FridayWork == FridayWork.Default).ToListAsync();
|
||||||
|
foreach (var workshopSetting in workshopSettings)
|
||||||
|
{
|
||||||
|
workshopSetting.FridayWorkToWeeklyDayOfWeek();
|
||||||
|
}
|
||||||
|
|
||||||
|
await _companyContext.SaveChangesAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private async Task AdminMonthlyOverviewTest()
|
private async Task AdminMonthlyOverviewTest()
|
||||||
{
|
{
|
||||||
var acc = _companyContext.WorkshopAccounts.FirstOrDefault(x => x.AccountId == 322);
|
var acc = _companyContext.WorkshopAccounts.FirstOrDefault(x => x.AccountId == 322);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
|
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
|
||||||
|
|
||||||
//server
|
//server
|
||||||
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]is[3019]#@ATt;TrustServerCertificate=true;",
|
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
|
||||||
|
|
||||||
|
|
||||||
//local
|
//local
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ function loadDataCameraAccountAjax() {
|
|||||||
|
|
||||||
<div class="Rtable-cell d-md-flex d-none justify-content-center width5">
|
<div class="Rtable-cell d-md-flex d-none justify-content-center width5">
|
||||||
<div class="Rtable-cell--content align-items-center d-flex d-md-flex text-end me-3">
|
<div class="Rtable-cell--content align-items-center d-flex d-md-flex text-end me-3">
|
||||||
<div class="d-flex align-items-center justify-content-center">
|
<div class="d-flex align-items-center justify-content-center ${hasActiveDeActvePersmission ? `` : `disable`}">
|
||||||
<span class="mx-1 df">فعال</span>
|
<span class="mx-1 df">فعال</span>
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
@@ -77,14 +77,26 @@ function loadDataCameraAccountAjax() {
|
|||||||
|
|
||||||
<div class="Rtable-cell d-md-flex justify-content-end width6">
|
<div class="Rtable-cell d-md-flex justify-content-end width6">
|
||||||
<div class="Rtable-cell--content align-items-center d-flex d-md-flex justify-content-end">
|
<div class="Rtable-cell--content align-items-center d-flex d-md-flex justify-content-end">
|
||||||
<button class="btn-pass ChangePassword d-none d-md-block" onclick="showModalCameraAccountChangePassword(${item.id})" id="CameraAccountChangePassword_${item.id}" type="button">
|
|
||||||
|
${hasEditCameraAccountPermission ?
|
||||||
|
`<button class="btn-pass ChangePassword d-none d-md-block" onclick="showModalCameraAccountChangePassword(${item.id})" id="CameraAccountChangePassword_${item.id}" type="button">
|
||||||
<span class="spanTxt d-none">تغییر گذرواژه</span>
|
<span class="spanTxt d-none">تغییر گذرواژه</span>
|
||||||
<span class="spanSvg">
|
<span class="spanSvg">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||||
</svg>
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>`
|
||||||
|
:
|
||||||
|
`<button class="btn-pass ChangePassword d-none d-md-block disable" type="button">
|
||||||
|
<span class="spanTxt d-none">تغییر گذرواژه</span>
|
||||||
|
<span class="spanSvg">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</button>`
|
||||||
|
}
|
||||||
|
|
||||||
<button type="button" class="btn-more position-relative d-md-none d-flex" style="width: 36px;padding: 0;height: 36px;align-items: center;justify-content: center;position: relative !important;">
|
<button type="button" class="btn-more position-relative d-md-none d-flex" style="width: 36px;padding: 0;height: 36px;align-items: center;justify-content: center;position: relative !important;">
|
||||||
<span class="mx-1 align-items-center d-flex justify-content-center"></span>
|
<span class="mx-1 align-items-center d-flex justify-content-center"></span>
|
||||||
@@ -109,7 +121,7 @@ function loadDataCameraAccountAjax() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-items-center justify-content-between my-1">
|
<div class="d-flex align-items-center justify-content-between my-1">
|
||||||
<span class="span1">وضعیت:</span>
|
<span class="span1">وضعیت:</span>
|
||||||
<div class="d-flex align-items-center justify-content-center">
|
<div class="d-flex align-items-center justify-content-center ${hasActiveDeActvePersmission ? `` : `disable`}">
|
||||||
<span class="span1 mx-1 df">فعال</span>
|
<span class="span1 mx-1 df">فعال</span>
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
@@ -133,14 +145,25 @@ function loadDataCameraAccountAjax() {
|
|||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="btn-pass ChangePassword w-100" onclick="showModalCameraAccountChangePassword(${item.id})" id="ChangePassword_${item.id}" type="button">
|
${hasEditCameraAccountPermission ?
|
||||||
|
`<button class="btn-pass ChangePassword w-100" onclick="showModalCameraAccountChangePassword(${item.id})" id="ChangePassword_${item.id}" type="button">
|
||||||
<span class="spanTxt">تغییر گذرواژه</span>
|
<span class="spanTxt">تغییر گذرواژه</span>
|
||||||
<span class="spanSvg">
|
<span class="spanSvg">
|
||||||
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||||
</svg>
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>`
|
||||||
|
:
|
||||||
|
`<button class="btn-pass ChangePassword w-100 disable" type="button">
|
||||||
|
<span class="spanTxt">تغییر گذرواژه</span>
|
||||||
|
<span class="spanSvg">
|
||||||
|
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</button>`
|
||||||
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user