Compare commits
73 Commits
5f7f63689c
...
FixCheckou
| Author | SHA1 | Date | |
|---|---|---|---|
| 925f43214c | |||
|
|
dec5666eb7 | ||
| e3b6d5f1c9 | |||
| 7c1fe65cf2 | |||
| f26fcba165 | |||
|
|
de2a6203df | ||
|
|
2208834a0e | ||
| de52a0be98 | |||
|
|
5bebec3fde | ||
|
|
cad808d73c | ||
| abef053f56 | |||
| 6469bf5a50 | |||
|
|
4fd5ef52ef | ||
|
|
61e2bdaaf5 | ||
| 8ab22d9948 | |||
|
|
17b5f5fee5 | ||
| 9e7e4ca655 | |||
|
|
100c9367ed | ||
| fdb6799c65 | |||
|
|
c81da3e787 | ||
|
|
d8c0471878 | ||
|
|
8418c2edc4 | ||
|
|
e109a41b90 | ||
|
|
158fc91a67 | ||
|
|
d1fb6e933d | ||
|
|
0811482370 | ||
| 24982e11d3 | |||
| 394d65db31 | |||
| 59deae29c2 | |||
|
|
46833f93da | ||
|
|
8d78ea548a | ||
|
|
ffbadc5a96 | ||
| e889b61d27 | |||
| b492aa39e8 | |||
| 2201ade168 | |||
|
|
baeeec183b | ||
|
|
3142a80b44 | ||
|
|
7c2354b386 | ||
|
|
175158a3d7 | ||
|
|
b79abcb175 | ||
|
|
7388fd8a81 | ||
|
|
a9c489b43d | ||
|
|
66ada45d29 | ||
|
|
04e51fe3b5 | ||
|
|
e486f20a5a | ||
|
|
2db6a9695c | ||
|
|
cea68fce49 | ||
|
|
3f2c0c5531 | ||
|
|
22f13aea0b | ||
| 0ec62e5e83 | |||
|
|
86a3a21d5b | ||
|
|
e02bc9adc5 | ||
|
|
39bc95731e | ||
|
|
759792b44b | ||
|
|
1409d30dfd | ||
|
|
ad9f747027 | ||
|
|
b021636913 | ||
|
|
3007a87104 | ||
|
|
d7eb8517f7 | ||
|
|
eaaab56421 | ||
|
|
7d763715cd | ||
|
|
7d1eb780a5 | ||
|
|
88a9a62dd3 | ||
|
|
6fd9b336a9 | ||
|
|
44d5225ff3 | ||
|
|
03e4f7e8c1 | ||
|
|
2c6512faa2 | ||
|
|
406212a1f0 | ||
|
|
53e93bd410 | ||
|
|
9311d68a91 | ||
|
|
9e91214941 | ||
|
|
3e3eccf0f0 | ||
|
|
789b0fbc24 |
@@ -12,65 +12,65 @@ namespace _0_Framework.Application;
|
||||
|
||||
public class AuthHelper : IAuthHelper
|
||||
{
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
|
||||
public AuthHelper(IHttpContextAccessor contextAccessor)
|
||||
{
|
||||
_contextAccessor = contextAccessor;
|
||||
}
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
|
||||
public AuthViewModel CurrentAccountInfo()
|
||||
{
|
||||
var result = new AuthViewModel();
|
||||
if (!IsAuthenticated())
|
||||
return result;
|
||||
public AuthHelper(IHttpContextAccessor contextAccessor)
|
||||
{
|
||||
_contextAccessor = contextAccessor;
|
||||
}
|
||||
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
|
||||
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
|
||||
result.ProfilePhoto = claims.FirstOrDefault(x => x.Type == "ProfilePhoto")?.Value;
|
||||
result.RoleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value);
|
||||
result.Fullname = claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value;
|
||||
result.Role = claims.FirstOrDefault(x => x.Type == "RoleName")?.Value;
|
||||
result.ClientAriaPermission =claims.FirstOrDefault(x => x.Type == "ClientAriaPermission").Value;
|
||||
result.AdminAreaPermission = claims.FirstOrDefault(x => x.Type == "AdminAreaPermission").Value;
|
||||
result.PositionValue = !string.IsNullOrWhiteSpace(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) ? int.Parse(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) : 0;
|
||||
result.WorkshopList = Tools.DeserializeFromBsonList<WorkshopClaim>(claims.FirstOrDefault(x => x is { Type: "workshopList" })?.Value);
|
||||
result.WorkshopSlug = claims.FirstOrDefault(x => x is { Type: "WorkshopSlug" }).Value;
|
||||
result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
|
||||
public AuthViewModel CurrentAccountInfo()
|
||||
{
|
||||
var result = new AuthViewModel();
|
||||
if (!IsAuthenticated())
|
||||
return result;
|
||||
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
|
||||
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
|
||||
result.ProfilePhoto = claims.FirstOrDefault(x => x.Type == "ProfilePhoto")?.Value;
|
||||
result.RoleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value);
|
||||
result.Fullname = claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value;
|
||||
result.Role = claims.FirstOrDefault(x => x.Type == "RoleName")?.Value;
|
||||
result.ClientAriaPermission = claims.FirstOrDefault(x => x.Type == "ClientAriaPermission").Value;
|
||||
result.AdminAreaPermission = claims.FirstOrDefault(x => x.Type == "AdminAreaPermission").Value;
|
||||
result.PositionValue = !string.IsNullOrWhiteSpace(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) ? int.Parse(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) : 0;
|
||||
result.WorkshopList = Tools.DeserializeFromBsonList<WorkshopClaim>(claims.FirstOrDefault(x => x is { Type: "workshopList" })?.Value);
|
||||
result.WorkshopSlug = claims.FirstOrDefault(x => x is { Type: "WorkshopSlug" }).Value;
|
||||
result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
|
||||
result.SubAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId").Value);
|
||||
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public List<int> GetPermissions()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return new List<int>();
|
||||
public List<int> GetPermissions()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return new List<int>();
|
||||
|
||||
var permissions = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "permissions")
|
||||
?.Value;
|
||||
return Tools.DeserializeFromBsonList<int>(permissions); //Mahan
|
||||
}
|
||||
var permissions = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "permissions")
|
||||
?.Value;
|
||||
return Tools.DeserializeFromBsonList<int>(permissions); //Mahan
|
||||
}
|
||||
|
||||
public long CurrentAccountId()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value)
|
||||
: 0;
|
||||
}
|
||||
public long CurrentSubAccountId()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "SubAccountId")?.Value)
|
||||
: 0;
|
||||
}
|
||||
public long CurrentAccountId()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value)
|
||||
: 0;
|
||||
}
|
||||
public long CurrentSubAccountId()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "SubAccountId")?.Value)
|
||||
: 0;
|
||||
}
|
||||
public string CurrentAccountMobile()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "Mobile")?.Value
|
||||
: "";
|
||||
}
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "Mobile")?.Value
|
||||
: "";
|
||||
}
|
||||
|
||||
#region Vafa
|
||||
|
||||
@@ -111,160 +111,166 @@ public class AuthHelper : IAuthHelper
|
||||
}
|
||||
|
||||
public string GetWorkshopSlug()
|
||||
{
|
||||
return CurrentAccountInfo().ClientAriaPermission == "true"
|
||||
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopSlug")?.Value
|
||||
: "";
|
||||
}
|
||||
public string GetWorkshopName()
|
||||
{
|
||||
var workshopName = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "ClientAriaPermission")?.Value == "true";
|
||||
if (workshopName)
|
||||
{
|
||||
return _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopName")?.Value;
|
||||
}
|
||||
{
|
||||
return CurrentAccountInfo().ClientAriaPermission == "true"
|
||||
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopSlug")?.Value
|
||||
: "";
|
||||
}
|
||||
public string GetWorkshopName()
|
||||
{
|
||||
var workshopName = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "ClientAriaPermission")?.Value == "true";
|
||||
if (workshopName)
|
||||
{
|
||||
return _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopName")?.Value;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public string CurrentAccountRole()
|
||||
{
|
||||
if (IsAuthenticated())
|
||||
return _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value;
|
||||
return null;
|
||||
}
|
||||
{
|
||||
if (IsAuthenticated())
|
||||
return _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value;
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool IsAuthenticated()
|
||||
{
|
||||
return _contextAccessor.HttpContext.User.Identity.IsAuthenticated;
|
||||
//var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
//if (claims.Count > 0)
|
||||
// return true;
|
||||
//return false;
|
||||
//return claims.Count > 0;
|
||||
}
|
||||
public bool IsAuthenticated()
|
||||
{
|
||||
return _contextAccessor.HttpContext.User.Identity.IsAuthenticated;
|
||||
//var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
//if (claims.Count > 0)
|
||||
// return true;
|
||||
//return false;
|
||||
//return claims.Count > 0;
|
||||
}
|
||||
|
||||
public void Signin(AuthViewModel account)
|
||||
{
|
||||
#region MahanChanges
|
||||
public void Signin(AuthViewModel account)
|
||||
{
|
||||
#region MahanChanges
|
||||
|
||||
var permissions = account.Permissions is { Count: > 0 } ? Tools.SerializeToBson(account.Permissions) : "";
|
||||
var workshopBson = account.WorkshopList is { Count: > 0 } ? Tools.SerializeToBson(account.WorkshopList) : "";
|
||||
var slug = account.WorkshopSlug ?? "";
|
||||
if (account.Id == 322)
|
||||
account.Permissions.AddRange([3060301, 30603, 30604, 30605]);
|
||||
|
||||
#endregion
|
||||
var permissions = account.Permissions is { Count: > 0 } ? Tools.SerializeToBson(account.Permissions) : "";
|
||||
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim("AccountId", account.Id.ToString()),
|
||||
new Claim(ClaimTypes.Name, account.Fullname),
|
||||
new Claim(ClaimTypes.Role, account.RoleId.ToString()),
|
||||
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
|
||||
|
||||
|
||||
var workshopBson = account.WorkshopList is { Count: > 0 } ? Tools.SerializeToBson(account.WorkshopList) : "";
|
||||
var slug = account.WorkshopSlug ?? "";
|
||||
|
||||
#endregion
|
||||
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim("AccountId", account.Id.ToString()),
|
||||
new Claim(ClaimTypes.Name, account.Fullname),
|
||||
new Claim(ClaimTypes.Role, account.RoleId.ToString()),
|
||||
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
|
||||
new Claim("permissions", permissions),
|
||||
new Claim("Mobile", account.Mobile),
|
||||
new Claim("ProfilePhoto", account.ProfilePhoto ),
|
||||
new Claim("RoleName", account.RoleName),
|
||||
new Claim("SubAccountId", account.SubAccountId.ToString()),
|
||||
new Claim("Mobile", account.Mobile),
|
||||
new Claim("ProfilePhoto", account.ProfilePhoto ),
|
||||
new Claim("RoleName", account.RoleName),
|
||||
new Claim("SubAccountId", account.SubAccountId.ToString()),
|
||||
new Claim("AdminAreaPermission", account.AdminAreaPermission.ToString()),
|
||||
new Claim("ClientAriaPermission", account.ClientAriaPermission.ToString()),
|
||||
new Claim("IsCamera", "false"),
|
||||
new Claim("PositionValue",account.PositionValue.ToString()),
|
||||
new Claim("ClientAriaPermission", account.ClientAriaPermission.ToString()),
|
||||
new Claim("IsCamera", "false"),
|
||||
new Claim("PositionValue",account.PositionValue.ToString()),
|
||||
//mahanChanges
|
||||
new("workshopList",workshopBson),
|
||||
new("WorkshopSlug",slug),
|
||||
new("WorkshopName",account.WorkshopName??"")
|
||||
new("WorkshopSlug",slug),
|
||||
new("WorkshopName",account.WorkshopName??"")
|
||||
|
||||
};
|
||||
|
||||
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
|
||||
var authProperties = new AuthenticationProperties
|
||||
{
|
||||
ExpiresUtc = DateTimeOffset.UtcNow.AddDays(1)
|
||||
};
|
||||
var authProperties = new AuthenticationProperties
|
||||
{
|
||||
ExpiresUtc = DateTimeOffset.UtcNow.AddDays(1)
|
||||
};
|
||||
|
||||
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
new ClaimsPrincipal(claimsIdentity),
|
||||
authProperties);
|
||||
}
|
||||
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
new ClaimsPrincipal(claimsIdentity),
|
||||
authProperties);
|
||||
}
|
||||
|
||||
#region Camera
|
||||
public void CameraSignIn(CameraAuthViewModel account)
|
||||
{
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim("AccountId", account.Id.ToString()),
|
||||
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
|
||||
#region Camera
|
||||
public void CameraSignIn(CameraAuthViewModel account)
|
||||
{
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim("AccountId", account.Id.ToString()),
|
||||
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
|
||||
new Claim("WorkshopId", account.WorkshopId.ToString()),
|
||||
new Claim("WorkshopName", account.WorkshopName),
|
||||
new Claim("Mobile", account.Mobile),
|
||||
new Claim("AccountId", account.AccountId.ToString()),
|
||||
new Claim("IsActiveString", account.IsActiveString),
|
||||
new Claim("IsCamera", "true"),
|
||||
new Claim("WorkshopName", account.WorkshopName),
|
||||
new Claim("Mobile", account.Mobile),
|
||||
new Claim("AccountId", account.AccountId.ToString()),
|
||||
new Claim("IsActiveString", account.IsActiveString),
|
||||
new Claim("IsCamera", "true"),
|
||||
|
||||
};
|
||||
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
};
|
||||
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
|
||||
var authProperties = new AuthenticationProperties
|
||||
{
|
||||
var authProperties = new AuthenticationProperties
|
||||
{
|
||||
|
||||
//ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30)
|
||||
ExpiresUtc = new DateTimeOffset(year: 2100, month: 1, day: 1, hour: 0, minute: 0, second: 0, offset: TimeSpan.Zero)
|
||||
};
|
||||
//ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30)
|
||||
ExpiresUtc = new DateTimeOffset(year: 2100, month: 1, day: 1, hour: 0, minute: 0, second: 0, offset: TimeSpan.Zero)
|
||||
};
|
||||
|
||||
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
new ClaimsPrincipal(claimsIdentity),
|
||||
authProperties);
|
||||
}
|
||||
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
new ClaimsPrincipal(claimsIdentity),
|
||||
authProperties);
|
||||
}
|
||||
|
||||
public CameraAuthViewModel CameraAccountInfo()
|
||||
{
|
||||
var result = new CameraAuthViewModel();
|
||||
if (!IsAuthenticated())
|
||||
return result;
|
||||
public CameraAuthViewModel CameraAccountInfo()
|
||||
{
|
||||
var result = new CameraAuthViewModel();
|
||||
if (!IsAuthenticated())
|
||||
return result;
|
||||
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
|
||||
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
|
||||
result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value);
|
||||
result.WorkshopName = claims.FirstOrDefault(x => x.Type == "WorkshopName").Value;
|
||||
result.Mobile = claims.FirstOrDefault(x => x.Type == "Mobile").Value;
|
||||
result.AccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId")?.Value);
|
||||
result.IsActiveString = claims.FirstOrDefault(x => x.Type == "IsActiveString").Value;
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
|
||||
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
|
||||
result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value);
|
||||
result.WorkshopName = claims.FirstOrDefault(x => x.Type == "WorkshopName").Value;
|
||||
result.Mobile = claims.FirstOrDefault(x => x.Type == "Mobile").Value;
|
||||
result.AccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId")?.Value);
|
||||
result.IsActiveString = claims.FirstOrDefault(x => x.Type == "IsActiveString").Value;
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void SignOut()
|
||||
{
|
||||
_contextAccessor.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
}
|
||||
public void SignOut()
|
||||
{
|
||||
_contextAccessor.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
}
|
||||
|
||||
|
||||
#region Pooya
|
||||
#region Pooya
|
||||
|
||||
public (long Id, UserType userType, long roleId) GetUserTypeWithId()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return (0, UserType.Anonymous, 0);
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
public (long Id, UserType userType, long roleId) GetUserTypeWithId()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return (0, UserType.Anonymous, 0);
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
|
||||
var subAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId")?.Value ?? "0");
|
||||
if (subAccountId > 0)
|
||||
return (subAccountId, UserType.SubAccount, 0);
|
||||
var subAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId")?.Value ?? "0");
|
||||
if (subAccountId > 0)
|
||||
return (subAccountId, UserType.SubAccount, 0);
|
||||
|
||||
var id = long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value);
|
||||
if (claims.FirstOrDefault(x => x.Type == "AdminAreaPermission")?.Value == "true")
|
||||
{
|
||||
var roleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value ?? "0");
|
||||
return (id, UserType.Admin, roleId);
|
||||
}
|
||||
var id = long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value);
|
||||
if (claims.FirstOrDefault(x => x.Type == "AdminAreaPermission")?.Value == "true")
|
||||
{
|
||||
var roleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value ?? "0");
|
||||
return (id, UserType.Admin, roleId);
|
||||
}
|
||||
|
||||
return (id, UserType.Client, 0);
|
||||
}
|
||||
#endregion
|
||||
return (id, UserType.Client, 0);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
@@ -385,11 +385,27 @@
|
||||
/// </summary>
|
||||
public const int SetWorkshopWorkingHoursPermissionCode = 10606;
|
||||
|
||||
#region حساب کاربری دوربین
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات حساب کاربری دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountSettingsPermissionCode = 10607;
|
||||
|
||||
/// <summary>
|
||||
/// فعال/غیرفعال اکانت دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountActivationBtnPermissionCode = 1060701;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش اکانت دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountEditPermissionCode = 1060702;
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region کارپوشه
|
||||
@@ -744,6 +760,22 @@
|
||||
Code = CameraAccountSettingsPermissionCode,
|
||||
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
|
||||
|
||||
#region کارپوشه,ParentId = WorkFlowOperationsPermissionCode
|
||||
|
||||
@@ -41,23 +41,6 @@ public static class Tools
|
||||
return Regex.IsMatch(mobileNo, "^((09))(\\d{9})$");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع و تعداد ماه را میگیرد و تاریخ پایان قراردا را بر میگرداند
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="monthPlus"></param>
|
||||
/// <returns></returns>
|
||||
public static (DateTime endDateGr, string endDateFa) FindEndOfContract(string startDate, string monthPlus)
|
||||
{
|
||||
|
||||
int startYear = Convert.ToInt32(startDate.Substring(0, 4));
|
||||
int startMonth = Convert.ToInt32(startDate.Substring(5, 2));
|
||||
int startDay = Convert.ToInt32(startDate.Substring(8, 2));
|
||||
var start = new PersianDateTime(startYear, startMonth, startDay);
|
||||
var end = (start.AddMonths(Convert.ToInt32(monthPlus))).AddDays(-1);
|
||||
return ($"{end}".ToGeorgianDateTime(), $"{end}");
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت روزهای کارکرد پرسنل در لیست بیمه ماه مشخص شده
|
||||
|
||||
@@ -4,4 +4,6 @@ public class AccountSelectListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public long RoleId { get; set; }
|
||||
}
|
||||
@@ -15,6 +15,6 @@ namespace AccountManagement.Application.Contracts.SubAccount
|
||||
public string PhoneNumber { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string ProfilePhoto { get; set; }
|
||||
public List<long> WorkshopIds { get; set; }
|
||||
//public List<long> WorkshopIds { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,6 @@ namespace AccountManagement.Application.Contracts.SubAccount
|
||||
public string Title { get; set; }
|
||||
public long AccountId { get; set; }
|
||||
public List<int> Permissions { get; set; }
|
||||
public List<long> WorkshopIds { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace AccountManagement.Application.Contracts.SubAccount
|
||||
public string PhoneNumber { get; set; }
|
||||
public string RePassword { get; set; }
|
||||
public long SubAccountRoleId { get; set; }
|
||||
public List<long> WorkshopIds { get; set; }
|
||||
//public List<long> WorkshopIds { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,5 +7,6 @@ namespace AccountManagement.Application.Contracts.SubAccount
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public List<int> Permissions { get; set; }
|
||||
public List<long> WorkshopIds { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public class AccountApplication : IAccountApplication
|
||||
{
|
||||
Slug = _passwordHasher.SlugHasher(x.WorkshopId),
|
||||
Name = x.WorkshopName,
|
||||
PersonnelCount = 0,
|
||||
PersonnelCount = x.PersonnelCount,
|
||||
Id = x.WorkshopId
|
||||
}).ToList();
|
||||
|
||||
|
||||
@@ -113,12 +113,12 @@ namespace AccountManagement.Application
|
||||
if (cmd.PhoneNumber.Length != 11)
|
||||
return op.Failed("شماره تلفن همراه نامعتبر است");
|
||||
|
||||
if (!cmd.WorkshopIds.Any())
|
||||
return op.Failed("حداقل یک کارگاه را انتخاب کنید");
|
||||
//if (!cmd.WorkshopIds.Any())
|
||||
// return op.Failed("حداقل یک کارگاه را انتخاب کنید");
|
||||
|
||||
|
||||
if (!cmd.WorkshopIds.All(x => accountWorkshopsList.Contains(x)))
|
||||
return op.Failed("خطای سیستمی");
|
||||
//if (!cmd.WorkshopIds.All(x => accountWorkshopsList.Contains(x)))
|
||||
// return op.Failed("خطای سیستمی");
|
||||
|
||||
|
||||
if (cmd.SubAccountRoleId == 0 || !_subAccountRoleRepository.Exists(x => cmd.SubAccountRoleId == x.id))
|
||||
@@ -131,6 +131,10 @@ namespace AccountManagement.Application
|
||||
_cameraAccountRepository.Exists(x => x.Username == cmd.Username))
|
||||
return op.Failed("نام کاربری نمی تواند تکراری باشد");
|
||||
|
||||
var role = _subAccountRoleRepository.Get(cmd.SubAccountRoleId);
|
||||
var workshopId = role.RoleWorkshops.Select(x => x.WorkshopId).ToList();
|
||||
|
||||
|
||||
var entity = new SubAccount(cmd.AccountId, cmd.SubAccountRoleId, cmd.NationalCode, cmd.FName, cmd.LName, cmd.PhoneNumber, cmd.Username, _passwordHasher.Hash(cmd.Password),
|
||||
cmd.ProfilePhoto);
|
||||
|
||||
@@ -142,7 +146,7 @@ namespace AccountManagement.Application
|
||||
_subAccountRepository.SaveChanges();
|
||||
|
||||
|
||||
var workshops = cmd.WorkshopIds.Select(x => new WorkshopSubAccount(x, entity.id));
|
||||
var workshops = workshopId.Select(x => new WorkshopSubAccount(x, entity.id));
|
||||
|
||||
foreach (var w in workshops)
|
||||
_workshopSubAccountRepository.Create(w);
|
||||
@@ -175,22 +179,22 @@ namespace AccountManagement.Application
|
||||
|
||||
|
||||
|
||||
if (!cmd.WorkshopIds.All(x => accountWorkshopsList.Contains(x)))
|
||||
return op.Failed("خطای سیستمی");
|
||||
//if (!cmd.WorkshopIds.All(x => accountWorkshopsList.Contains(x)))
|
||||
// return op.Failed("خطای سیستمی");
|
||||
|
||||
|
||||
if (cmd.SubAccountRoleId == 0 || !_subAccountRoleRepository.Exists(x => cmd.SubAccountRoleId == x.id))
|
||||
return op.Failed("نقش مورد نظر وجود ندارد");
|
||||
|
||||
var workshopSubAccounts = _workshopSubAccountRepository.GetWorkshopsSubAccountEntityBySubAccountId(entity.id);
|
||||
foreach (var workshopSubAccount in workshopSubAccounts)
|
||||
_workshopSubAccountRepository.Remove(workshopSubAccount);
|
||||
//var workshopSubAccounts = _workshopSubAccountRepository.GetWorkshopsSubAccountEntityBySubAccountId(entity.id);
|
||||
//foreach (var workshopSubAccount in workshopSubAccounts)
|
||||
// _workshopSubAccountRepository.Remove(workshopSubAccount);
|
||||
|
||||
|
||||
var workshops = cmd.WorkshopIds.Select(x => new WorkshopSubAccount(x, entity.id));
|
||||
//var workshops = cmd.WorkshopIds.Select(x => new WorkshopSubAccount(x, entity.id));
|
||||
|
||||
foreach (var w in workshops)
|
||||
_workshopSubAccountRepository.Create(w);
|
||||
//foreach (var w in workshops)
|
||||
// _workshopSubAccountRepository.Create(w);
|
||||
|
||||
entity.Edit(cmd.SubAccountRoleId, cmd.NationalCode, cmd.FName, cmd.LName, cmd.ProfilePhoto);
|
||||
_workshopSubAccountRepository.SaveChanges();
|
||||
@@ -227,7 +231,8 @@ namespace AccountManagement.Application
|
||||
{
|
||||
Id = entity.id,
|
||||
Title = entity.Title,
|
||||
Permissions = entity.RolePermissions.Select(x => x.PermissionCode).ToList()
|
||||
Permissions = entity.RolePermissions.Select(x => x.PermissionCode).ToList(),
|
||||
WorkshopIds = entity.RoleWorkshops.Select(x=>x.WorkshopId).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
@@ -241,7 +246,7 @@ namespace AccountManagement.Application
|
||||
OperationResult op = new();
|
||||
if (_subAccountRoleRepository.Exists(x => x.AccountId == command.AccountId && x.Title.Trim() == command.Title.Trim()))
|
||||
return op.Failed("یک نقش با این عنوان وجود دارد");
|
||||
var role = new SubAccountRole(command.Title, command.Permissions, command.AccountId);
|
||||
var role = new SubAccountRole(command.Title, command.Permissions, command.AccountId,command.WorkshopIds);
|
||||
_subAccountRoleRepository.Create(role);
|
||||
_subAccountRoleRepository.SaveChanges();
|
||||
return op.Succcedded(role.id);
|
||||
@@ -254,8 +259,26 @@ namespace AccountManagement.Application
|
||||
var entity = _subAccountRoleRepository.Get(cmd.Id);
|
||||
if (entity == null)
|
||||
return op.Failed(ApplicationMessages.RecordNotFound);
|
||||
entity.Edit(cmd.Title, cmd.Permissions);
|
||||
_subAccountRoleRepository.SaveChanges();
|
||||
entity.Edit(cmd.Title, cmd.Permissions,cmd.WorkshopIds);
|
||||
|
||||
var subAccountRoles = _subAccountRepository.GetBySubAccountRole(cmd.Id);
|
||||
|
||||
foreach (var subAccount in subAccountRoles)
|
||||
{
|
||||
var workshopSubAccounts = _workshopSubAccountRepository.GetWorkshopsSubAccountEntityBySubAccountId(subAccount.id);
|
||||
foreach (var workshopSubAccount in workshopSubAccounts)
|
||||
_workshopSubAccountRepository.Remove(workshopSubAccount);
|
||||
|
||||
|
||||
var workshops = cmd.WorkshopIds.Select(x => new WorkshopSubAccount(x, subAccount.id));
|
||||
|
||||
foreach (var w in workshops)
|
||||
_workshopSubAccountRepository.Create(w);
|
||||
}
|
||||
|
||||
_subAccountRoleRepository.SaveChanges();
|
||||
_workshopSubAccountRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult AssignRoleToSubAccount(AssignSubAccountRole command)
|
||||
|
||||
@@ -597,7 +597,7 @@ public class TaskApplication : ITaskApplication
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
assign.AcceptTimeRequest();
|
||||
message = string.IsNullOrWhiteSpace(message) ? "درخواست شما مورد تایید قرار گرفت" : message;
|
||||
var messageEntity = new TaskMessage(message, "تایید درخواست مهلت", assign.id);
|
||||
@@ -622,6 +622,7 @@ public class TaskApplication : ITaskApplication
|
||||
{
|
||||
return operation.Failed("چنین وظیفه ای درخواستی برای مهلت ندارد");
|
||||
}
|
||||
|
||||
assign.RejectTimeRequest();
|
||||
if (assign.EndTaskDate.Date <= DateTime.Now.Date)
|
||||
{
|
||||
|
||||
@@ -71,14 +71,16 @@ public class Assign : EntityBase
|
||||
|
||||
public void AcceptTimeRequest()
|
||||
{
|
||||
TimeRequest = false;
|
||||
ClearRequests();
|
||||
TimeRequest = false;
|
||||
AcceptedTimeRequest++;
|
||||
EndTaskDate = RequestDate < DateTime.Today ? DateTime.Today : RequestDate.Value;
|
||||
|
||||
}
|
||||
public void RejectTimeRequest()
|
||||
{
|
||||
TimeRequest = false;
|
||||
ClearRequests();
|
||||
TimeRequest = false;
|
||||
TimeRequestDescription = null;
|
||||
RequestDate = null;
|
||||
}
|
||||
@@ -92,31 +94,36 @@ public class Assign : EntityBase
|
||||
}
|
||||
public void AcceptCancelRequest()
|
||||
{
|
||||
IsCanceledRequest = false;
|
||||
ClearRequests();
|
||||
IsCanceledRequest = false;
|
||||
IsCancel = true;
|
||||
|
||||
|
||||
}
|
||||
public void RejectCancel()
|
||||
{
|
||||
CancelDescription = null;
|
||||
ClearRequests();
|
||||
CancelDescription = null;
|
||||
IsCanceledRequest = false;
|
||||
}
|
||||
|
||||
public void CompleteRequest(string? doneDescription)
|
||||
{
|
||||
DoneDescription = doneDescription;
|
||||
ClearRequests();
|
||||
DoneDescription = doneDescription;
|
||||
IsDoneRequest = true;
|
||||
}
|
||||
|
||||
public void RejectCompleteRequest()
|
||||
{
|
||||
IsDoneRequest = false;
|
||||
ClearRequests();
|
||||
IsDoneRequest = false;
|
||||
DoneDescription = null;
|
||||
}
|
||||
public void Completed()
|
||||
{
|
||||
IsDoneRequest = false;
|
||||
ClearRequests();
|
||||
IsDoneRequest = false;
|
||||
IsDone = true;
|
||||
}
|
||||
|
||||
@@ -128,6 +135,13 @@ public class Assign : EntityBase
|
||||
TimeRequest = false;
|
||||
}
|
||||
|
||||
public void ClearRequests()
|
||||
{
|
||||
IsDoneRequest = false;
|
||||
IsCanceledRequest = false;
|
||||
TimeRequest = false;
|
||||
}
|
||||
|
||||
public void InsertNewData(DateTime endTaskDate,bool timeRequest,int acceptedTimeRequest,DateTime? requestDate, string timeRequestDescription, bool isCanceledRequest,
|
||||
bool isCancel,string cancelDescription,bool isDone,bool isDoneRequest,string? doneDescription)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using _0_Framework.Domain;
|
||||
using AccountManagement.Application.Contracts.SubAccount;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace AccountManagement.Domain.SubAccountAgg
|
||||
{
|
||||
@@ -13,5 +14,6 @@ namespace AccountManagement.Domain.SubAccountAgg
|
||||
SubAccount GetDetails(long subAccountId);
|
||||
SubAccount GetBy(string commandUsername);
|
||||
SubAccountViewModel GetByVerifyCodeAndPhoneNumber(string code, string phone);
|
||||
List<SubAccount> GetBySubAccountRole(long subAccountRoleId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,17 +13,21 @@ namespace AccountManagement.Domain.SubAccountRoleAgg
|
||||
|
||||
public List<SubAccountRolePermission> RolePermissions { get; private set; }
|
||||
public List<SubAccount> SubAccounts { get; private set; }
|
||||
public List<SubAccountRoleWorkshop> RoleWorkshops { get; set; }
|
||||
|
||||
private SubAccountRole()
|
||||
{
|
||||
}
|
||||
|
||||
public SubAccountRole(string title, List<int> permissions, long accountId)
|
||||
public SubAccountRole(string title, List<int> permissions, long accountId, List<long> workshopIds)
|
||||
{
|
||||
Title = title;
|
||||
RolePermissions = permissions.Select(x => new SubAccountRolePermission(x, id)).ToList();
|
||||
AccountId = accountId;
|
||||
RoleWorkshops = workshopIds.Select(x => new SubAccountRoleWorkshop(x, id)).ToList();
|
||||
|
||||
}
|
||||
|
||||
public void ChangeTitle(string title)
|
||||
{
|
||||
Title = title;
|
||||
@@ -32,10 +36,12 @@ namespace AccountManagement.Domain.SubAccountRoleAgg
|
||||
{
|
||||
RolePermissions.AddRange(permissionIds.Select(x => new SubAccountRolePermission(x, id)));
|
||||
}
|
||||
public void Edit(string title, List<int> permissions)
|
||||
public void Edit(string title, List<int> permissions,List<long> workshopIds)
|
||||
{
|
||||
Title = title;
|
||||
RolePermissions = permissions.Select(x => new SubAccountRolePermission(x, id)).ToList();
|
||||
}
|
||||
}
|
||||
RoleWorkshops = workshopIds.Select(x => new SubAccountRoleWorkshop(x, id)).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace AccountManagement.Domain.SubAccountRoleAgg;
|
||||
|
||||
public class SubAccountRoleWorkshop:EntityBase
|
||||
{
|
||||
public SubAccountRoleWorkshop(long workshopId, long subAccountId)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
SubAccountId = subAccountId;
|
||||
}
|
||||
|
||||
public long WorkshopId { get; set; }
|
||||
public long SubAccountId { get; set; }
|
||||
public SubAccountRole SubAccountRole { get; set; }
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public class TaskSchedule:EntityBase
|
||||
UnitType = unitType;
|
||||
UnitNumber = unitNumber;
|
||||
LastEndTaskDate = lastEndTaskDate;
|
||||
IsActive = IsActive.False;
|
||||
IsActive = IsActive.True;
|
||||
}
|
||||
public string Count { get; private set; }
|
||||
public TaskScheduleType Type { get; private set; }
|
||||
|
||||
@@ -21,6 +21,10 @@ namespace AccountMangement.Infrastructure.EFCore.Mappings
|
||||
opt.WithOwner(x => x.SubAccountRole);
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.RoleWorkshops, roleWorkshop =>
|
||||
{
|
||||
roleWorkshop.WithOwner(x => x.SubAccountRole).HasForeignKey(x => x.SubAccountId);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1303
AccountMangement.Infrastructure.EFCore/Migrations/20250530133036_add workshop to subAccountRole.Designer.cs
generated
Normal file
1303
AccountMangement.Infrastructure.EFCore/Migrations/20250530133036_add workshop to subAccountRole.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace AccountMangement.Infrastructure.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addworkshoptosubAccountRole : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SubAccountRoleWorkshop",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
SubAccountId = table.Column<long>(type: "bigint", nullable: false),
|
||||
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SubAccountRoleWorkshop", x => new { x.SubAccountId, x.id });
|
||||
table.ForeignKey(
|
||||
name: "FK_SubAccountRoleWorkshop_SubAccountRoles_SubAccountId",
|
||||
column: x => x.SubAccountId,
|
||||
principalTable: "SubAccountRoles",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "SubAccountRoleWorkshop");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1078,6 +1078,33 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
|
||||
|
||||
modelBuilder.Entity("AccountManagement.Domain.SubAccountRoleAgg.SubAccountRole", b =>
|
||||
{
|
||||
b.OwnsMany("AccountManagement.Domain.SubAccountRoleAgg.SubAccountRoleWorkshop", "RoleWorkshops", b1 =>
|
||||
{
|
||||
b1.Property<long>("SubAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("id"));
|
||||
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.HasKey("SubAccountId", "id");
|
||||
|
||||
b1.ToTable("SubAccountRoleWorkshop");
|
||||
|
||||
b1.WithOwner("SubAccountRole")
|
||||
.HasForeignKey("SubAccountId");
|
||||
|
||||
b1.Navigation("SubAccountRole");
|
||||
});
|
||||
|
||||
b.OwnsMany("AccountManagement.Domain.SubAccountRoleAgg.SubAccountRolePermission", "RolePermissions", b1 =>
|
||||
{
|
||||
b1.Property<long>("id")
|
||||
@@ -1105,6 +1132,8 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
|
||||
});
|
||||
|
||||
b.Navigation("RolePermissions");
|
||||
|
||||
b.Navigation("RoleWorkshops");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AccountManagement.Domain.TaskAgg.Tasks", b =>
|
||||
|
||||
@@ -318,7 +318,8 @@ public class AccountRepository : RepositoryBase<long, Account>, IAccountReposito
|
||||
return await _context.Accounts.Where(x => x.AdminAreaPermission == "true").Select(x => new AccountSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Name = x.Fullname
|
||||
Name = x.Fullname,
|
||||
RoleId = x.RoleId
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,5 +77,10 @@ namespace AccountMangement.Infrastructure.EFCore.Repository
|
||||
Username = entity.Username
|
||||
};
|
||||
}
|
||||
|
||||
public List<SubAccount> GetBySubAccountRole(long subAccountRoleId)
|
||||
{
|
||||
return _context.SubAccounts.Where(x => x.SubAccountRoleId == subAccountRoleId).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -900,7 +900,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
AcceptedTimeRequest = x.AcceptedTimeRequest,
|
||||
IsCancelRequest = x.IsCancelRequest,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
Color = x.IsDone ? "green" : SetTasksColors(x.EndTaskDateGE, x.IsCancel, false),
|
||||
Color = x.IsDone ? "green" : SetTasksColors(x.EndTaskDateGE, x.IsCancel,false),
|
||||
MediaCount = x.MediaCount,
|
||||
HasAttachment = x.MediaCount > 0,
|
||||
SelfName = x.SelfName,
|
||||
@@ -1866,7 +1866,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
.Include(x => x.Task).ThenInclude(x => x.TaskSchedule)
|
||||
.Where(x =>
|
||||
x.Task.IsActiveString == "true" && x.Task.SenderId == accountId
|
||||
&& x.Task.TaskScheduleId != null && x.Task.TaskScheduleId > 0 && (!x.IsCanceledRequest && !x.TimeRequest && !x.IsDoneRequest) && x.Task.TaskSchedule.IsActive == IsActive.True);
|
||||
&& x.Task.TaskScheduleId != null && x.Task.TaskScheduleId > 0 && (!x.IsCanceledRequest && !x.TimeRequest && !x.IsDoneRequest) && x.Task.TaskSchedule.IsActive== IsActive.True);
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.GeneralSearch))
|
||||
{
|
||||
raw = raw.Where(x =>
|
||||
@@ -2153,7 +2153,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
return final;
|
||||
}
|
||||
|
||||
public string SetTasksColors(DateTime date, bool isCancel, bool hasRequest)
|
||||
public string SetTasksColors(DateTime date, bool isCancel,bool hasRequest)
|
||||
{
|
||||
if (hasRequest)
|
||||
return "red";
|
||||
@@ -2735,7 +2735,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
var raw = _accountContext.Assigns.Include(x => x.Task).ThenInclude(x => x.TaskMedias)
|
||||
.ThenInclude(x => x.Media)
|
||||
.Where(x =>
|
||||
x.Task.IsActiveString == "true" && x.AssignedId == accountId && x.Task.TicketId == null);
|
||||
x.Task.IsActiveString == "true" && x.AssignedId == accountId && x.Task.TicketId == null &&!x.IsDoneRequest && !x.IsCanceledRequest);
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.GeneralSearch))
|
||||
{
|
||||
raw = raw.Where(x =>
|
||||
@@ -2768,7 +2768,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
MediaCount = _accountContext.TaskMedias.Count(m => m.TaskId == x.Task.id),
|
||||
Description = x.Task.Description,
|
||||
IsDoneRequest = x.IsDoneRequest,
|
||||
|
||||
|
||||
});
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.GeneralSearch))
|
||||
{
|
||||
@@ -2878,8 +2878,8 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
|
||||
|
||||
var orderResult = result.OrderBy(x => x.IsDone || x.IsCancel)
|
||||
.ThenByDescending(x => x.EndTaskDateGE <= today.AddDays(1) && !x.HasRequest)
|
||||
.ThenByDescending(x => x.HasRequest)
|
||||
.ThenByDescending(x => x.EndTaskDateGE <= today.AddDays(1) && !x.RequestTime)
|
||||
.ThenByDescending(x => x.RequestTime)
|
||||
.ThenBy(x => x.EndTaskDateGE); // مرتبسازی داخلی بر اساس تاریخ
|
||||
|
||||
|
||||
@@ -2915,7 +2915,6 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
SelfName = x.SelfName,
|
||||
Description = x.Description,
|
||||
IsDoneRequest = x.IsDoneRequest,
|
||||
HasRequest = x.IsDoneRequest || x.RequestTime || x.IsCancelRequest
|
||||
|
||||
}).ToList();
|
||||
|
||||
@@ -2943,7 +2942,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
AcceptedTimeRequest = x.AcceptedTimeRequest,
|
||||
IsCancelRequest = x.IsCancelRequest,
|
||||
ContractingPartyName = x.ContractingPartyName,
|
||||
Color = x.IsDone ? "green" : SetTasksColors(x.EndTaskDateGE, x.IsCancel, x.HasRequest),
|
||||
Color = x.IsDone ? "green" : SetTasksColors(x.EndTaskDateGE, x.IsCancel,x.RequestTime),
|
||||
MediaCount = x.MediaCount,
|
||||
HasAttachment = x.MediaCount > 0,
|
||||
SelfName = x.SelfName,
|
||||
@@ -3003,6 +3002,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
AssignedPositionValue = 0
|
||||
},
|
||||
HasRequest = x.IsCancelRequest || x.RequestTime || x.IsDoneRequest
|
||||
|
||||
}).ToList();
|
||||
return final;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,23 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
||||
EditCheckout GetDetails(long id);
|
||||
|
||||
Task CreateCkeckout(Checkout command);
|
||||
/// <summary>
|
||||
/// لود لیست اولیه جهت ایجاد فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="month"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year,
|
||||
string month,
|
||||
string contractStart, string contractEnd);
|
||||
//void CreateCkeckout(Checkout command);
|
||||
|
||||
|
||||
|
||||
Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel);
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public class ContactUs:EntityBase
|
||||
{
|
||||
public ContactUs(string firstName, string lastName, string email, string phoneNumber, string title, string message)
|
||||
{
|
||||
FirstName = firstName.Trim();
|
||||
LastName = lastName.Trim();
|
||||
Email = email;
|
||||
PhoneNumber = phoneNumber;
|
||||
Title = title;
|
||||
Message = message;
|
||||
FullName = FirstName + " " + LastName;
|
||||
}
|
||||
|
||||
public string FirstName { get; private set; }
|
||||
public string LastName { get; private set; }
|
||||
public string Email { get; private set; }
|
||||
public string PhoneNumber { get; private set; }
|
||||
public string Title { get; private set; }
|
||||
public string Message { get; private set; }
|
||||
public string FullName { get; private set; }
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public interface IContactUsRepository : IRepository<long, ContactUs>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -213,7 +213,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
earlyExit.EarlyExitTimeFines.Select(x => new EarlyExitTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), earlyExit.Value);
|
||||
}
|
||||
|
||||
public void UpdateIsShiftChange()
|
||||
{
|
||||
var groupSetting = CustomizeWorkshopGroupSettings;
|
||||
@@ -270,10 +269,4 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
|
||||
IsShiftChanged = isShiftChange;
|
||||
}
|
||||
|
||||
|
||||
public void SetSalary(double salary)
|
||||
{
|
||||
Salary = salary;
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
|
||||
double GetcontractAmount(int countPerson);
|
||||
|
||||
string ExpColor(DateTime contractEndGr, double contractAmount,
|
||||
(string result, string isExpier) ExpColor(DateTime contractEndGr, double contractAmount,
|
||||
string isActiveString);
|
||||
|
||||
TotalbalancViewModel TotalBalance(long contractingPartyId);
|
||||
|
||||
@@ -52,5 +52,8 @@ public interface ILeftWorkInsuranceRepository : IRepository<long, LeftWorkInsura
|
||||
/// <returns></returns>
|
||||
List<LeftWorkViewModel> GetEmployeesWithContractExitOnly(long workshopId);
|
||||
|
||||
LeftWorkInsurance GetLastLeftWorkByEmployeeIdAndWorkshopId(long workshopId, long employeeId);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -16,7 +16,19 @@ namespace Company.Domain.RollCallAgg;
|
||||
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
{
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
|
||||
TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate);
|
||||
|
||||
/// <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);
|
||||
|
||||
List<RotatingShiftViewModel> RotatingShiftCheck(List<GroupedRollCalls> rollCallList);
|
||||
|
||||
@@ -26,12 +38,6 @@ public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
List<LateToWorkEarlyExistSpannig> LateToWorkEarlyExit(List<GroupedRollCalls> groupedRollCall,
|
||||
ICollection<CustomizeWorkshopEmployeeSettingsShift> shiftSettings, List<LeaveViewModel> leavList);
|
||||
|
||||
List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart,
|
||||
DateTime contractEnd);
|
||||
|
||||
List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart,
|
||||
DateTime checkoutEnd);
|
||||
|
||||
/// <summary>
|
||||
/// گزارش نوبت کاری حضور غیاب
|
||||
/// </summary>
|
||||
@@ -41,6 +47,12 @@ public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <param name="shiftwork"></param>
|
||||
/// <returns></returns>
|
||||
List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart,
|
||||
DateTime contractEnd);
|
||||
|
||||
List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart,
|
||||
DateTime checkoutEnd);
|
||||
|
||||
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
||||
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command,bool holidayWorking);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
|
||||
@@ -6,6 +7,7 @@ namespace Company.Domain.RollCallEmployeeAgg;
|
||||
|
||||
public interface IRollCallEmployeeRepository : IRepository<long, RollCallEmployee>
|
||||
{
|
||||
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd);
|
||||
List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId);
|
||||
EditRollCallEmployee GetDetails(long id);
|
||||
RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId);
|
||||
|
||||
@@ -23,6 +23,7 @@ public class SalaryAid : EntityBase
|
||||
CalculationMonth = calculationMonth;
|
||||
CalculationYear = calculationYear;
|
||||
}
|
||||
|
||||
public long EmployeeId { get; private set; }
|
||||
public long WorkshopId { get; private set; }
|
||||
public double Amount { get; private set; }
|
||||
|
||||
@@ -14,7 +14,5 @@ public interface IWorkshopTempRepository : IRepository<long, WorkshopTemp>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopTempViewModel>> GetWorkshopTemp(long contractingPartyTemp);
|
||||
|
||||
System.Threading.Tasks.Task RemoveWorkshopTemps(List<long> workshopTempIds);
|
||||
|
||||
|
||||
}
|
||||
@@ -34,14 +34,12 @@ public class InstitutionContractTemp : EntityBase
|
||||
/// بصورت یکجا
|
||||
/// -
|
||||
/// بصئورت ماهیانه
|
||||
/// OneTime
|
||||
/// </summary>
|
||||
public string PaymentModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// چند ماهه؟
|
||||
/// "12"
|
||||
/// </summary>
|
||||
public string PeriodModel { get; private set; }
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ public class AdminMonthlyOverviewListViewModel
|
||||
public long WorkshopId { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
public string WorkshopArchiveCode { get; set; }
|
||||
public int WorkshopArchiveCodeInt { get; set; }
|
||||
public string Province { get; set; }
|
||||
public string City { get; set; }
|
||||
public string Address { get; set; }
|
||||
@@ -74,7 +75,8 @@ public class AdminMonthlyOverviewListViewModel
|
||||
public string AdminFullName { get; set; }
|
||||
public string EmployerName { get; set; }
|
||||
public string EmployerPhoneNumber { get; set; }
|
||||
public int EmployeeCount { get; set; }
|
||||
public int ContractEmployeeCount { get; set; }
|
||||
public int CheckoutEmployeeCount { get; set; }
|
||||
public AdminMonthlyOverviewStatus Status { get; set; }
|
||||
public bool IsBlock { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Checkout;
|
||||
|
||||
public class CreateCheckoutListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public long PersonnelCode { get; set; }
|
||||
|
||||
public long EmployeeId { get; set; }
|
||||
|
||||
public string ContractNo { get; set; }
|
||||
|
||||
public string EmployerName { get; set; }
|
||||
|
||||
public string WorkshopName { get; set; }
|
||||
public string EmployeeName { get; set; }
|
||||
|
||||
public string ContractStart { get; set; }
|
||||
|
||||
public string ContractEnd { get; set; }
|
||||
|
||||
public string LeftWorkDate { get; set; }
|
||||
|
||||
//public string NextMonthStart { get; set; }
|
||||
|
||||
//public bool RedColor { get; set; }
|
||||
|
||||
public bool LaterThanEnd { get; set; }
|
||||
|
||||
public bool Extension { get; set; }
|
||||
|
||||
public bool HasCheckout { get; set; }
|
||||
|
||||
//public bool MoreThanOneMonth { get; set; }
|
||||
|
||||
//public bool Waiting { get; set; }
|
||||
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
|
||||
public List<CreateCheckoutListViewModel> CreateCheckoutList { get; set; }
|
||||
}
|
||||
@@ -13,7 +13,20 @@ public interface ICheckoutApplication
|
||||
OperationResult Edit(EditCheckout command);
|
||||
EditCheckout GetDetails(long id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لود لیست اولیه جهت ایجاد فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="month"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year,
|
||||
string month,
|
||||
string contractStart, string contractEnd);
|
||||
Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel);
|
||||
List<CheckoutViewModel> SimpleSearch(CheckoutSearchModel searchModel);
|
||||
List<CheckoutViewModel> PrintAll(List<long> id);
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.ContactUs;
|
||||
|
||||
public interface IContactUsApplication
|
||||
{
|
||||
OperationResult Create(CreateContactUs command);
|
||||
}
|
||||
|
||||
public class CreateContactUs
|
||||
{
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Message { get; set; }
|
||||
}
|
||||
@@ -8,7 +8,6 @@ public class CustomizeWorkshopGroupSettingsViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public double Salary { get; set; }
|
||||
public string SalaryStr { get; set; }
|
||||
public string GroupName { get; set; }
|
||||
public bool MainGroup { get; set; }
|
||||
public List<CustomizeWorkshopShiftViewModel> RollCallWorkshopShifts { get; set; }
|
||||
@@ -19,5 +18,4 @@ public class CustomizeWorkshopGroupSettingsViewModel
|
||||
public BreakTime BreakTime { get; set; }
|
||||
public FridayWork FridayWork { get; set; }
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
public int LeavePermitted { get; set; }
|
||||
}
|
||||
@@ -28,10 +28,6 @@ public class CreateEmployeeByClient
|
||||
public List<AddEmployeeDocumentItem> EmployeeDocumentItems { get; set; }
|
||||
public bool HasEmployeeDocument { get; set; }
|
||||
public bool HasRollCallService { get; set; }
|
||||
public bool HasCustomizeCheckoutService { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,4 +69,5 @@ public class InstitutionContractViewModel
|
||||
public double ValueAddedTax { get; set; }
|
||||
public int LeftWorkEmployeeCount { get; set; }
|
||||
public int InsuranceLeftWorkEmployeeCount { get; set; }
|
||||
public string IsExpier { get; set; }
|
||||
}
|
||||
@@ -38,4 +38,5 @@ public interface IRollCallEmployeeApplication
|
||||
(int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId);
|
||||
bool HasEmployees(long workshopId);
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -17,5 +17,7 @@ namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus
|
||||
List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr);
|
||||
|
||||
bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
|
||||
}
|
||||
void SyncRollCallEmployeeWithLeftWork(long rollCallEmployeeId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ public class SalaryAidGroupedByDateViewModel
|
||||
{
|
||||
public string MonthFa { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
public int Month { get; set; }
|
||||
public int Year { get; set; }
|
||||
public List<SalaryAidGroupedByDateViewModelItems> SalaryAidViewModels { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ public class SalaryAidViewModel
|
||||
public string CalculationDateTimeFa { get; set; }
|
||||
public DateTime CalculationDateTimeGe { get; set; }
|
||||
|
||||
|
||||
public int Month { get; set; }
|
||||
public int Year { get; set; }
|
||||
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
@@ -39,7 +38,7 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId);
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت جمع کل خدمات برای یک کارگاه
|
||||
@@ -56,14 +55,14 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <param name="paymentModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
|
||||
string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth");
|
||||
string periodModel = "12", string paymentModel = "OneTime");
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد یا ویرایش قرارداد موقت
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart);
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت کد برای کلاینت
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class MonthlyInstallment
|
||||
{
|
||||
/// <summary>
|
||||
/// مبلغ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstallmentAmountStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstalmentDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شمارنده قسط
|
||||
/// </summary>
|
||||
public string InstallmentCounter{ get; set; }
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
@@ -24,54 +23,28 @@ public class ReviewAndPaymentViewModel
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double OneTimeWithoutTaxPaymentDouble { get; set; }
|
||||
public double WithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string OneTimeWithoutTaxPaymentStr { get; set; }
|
||||
public string WithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double OneTimeTotalPaymentDouble { get; set; }
|
||||
public double TotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string OneTimeTotalPaymentStr { get; set; }
|
||||
public string TotalPaymentStr { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyTotalPaymentStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مالیات بر ارزش افزوده
|
||||
/// Double
|
||||
@@ -110,52 +83,4 @@ public class ReviewAndPaymentViewModel
|
||||
/// آی دی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست اقساط ماهیانه
|
||||
/// </summary>
|
||||
public List<MonthlyInstallment> MonthlyInstallments { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartCurrentMonthFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartCurrentMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartNextMonthFa{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartNextMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractEndGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractEndFa { get; set; }
|
||||
}
|
||||
@@ -7,5 +7,6 @@ namespace CompanyManagment.App.Contracts.Workshop
|
||||
public string WorkshopName { get; set; }
|
||||
public long SubAccountId { get; set; }
|
||||
public string IsActive { get; set; }
|
||||
public int PersonnelCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,6 +239,13 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
return _checkoutRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public async Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year, string month,
|
||||
string contractStart, string contractEnd)
|
||||
{
|
||||
return await _checkoutRepository.GetContractResultToCreateCheckout(workshopId, employeeId, year, month, contractStart,
|
||||
contractEnd);
|
||||
|
||||
}
|
||||
public async Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel)
|
||||
{
|
||||
var result = new List<CheckoutViewModel>();
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class ContactUsApplication : IContactUsApplication
|
||||
{
|
||||
private readonly IContactUsRepository _contactUsRepository;
|
||||
|
||||
public ContactUsApplication(IContactUsRepository contactUsRepository)
|
||||
{
|
||||
_contactUsRepository = contactUsRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateContactUs command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
if (string.IsNullOrWhiteSpace(command.FirstName))
|
||||
{
|
||||
return op.Failed("لطفا نام خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.LastName))
|
||||
{
|
||||
return op.Failed("لطفا نام خانوادگی خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Email))
|
||||
{
|
||||
return op.Failed("لطفا ایمیل خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.PhoneNumber))
|
||||
{
|
||||
return op.Failed("لطفا شماره تماس خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(command.PhoneNumber, @"^(\+98|0)?9\d{9}$"))
|
||||
{
|
||||
return op.Failed("شماره تماس وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(command.Email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$"))
|
||||
{
|
||||
return op.Failed("ایمیل وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Title))
|
||||
{
|
||||
return op.Failed("لطفا عنوان پیغام خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Message))
|
||||
{
|
||||
return op.Failed("لطفا پیغام خود را وارد کنید");
|
||||
}
|
||||
|
||||
var entity = new ContactUs(command.FirstName, command.LastName, command.Email, command.PhoneNumber,
|
||||
command.Title, command.Message);
|
||||
|
||||
_contactUsRepository.Create(entity);
|
||||
|
||||
_contactUsRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,13 +19,12 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using Hangfire.States;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -373,10 +372,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
}
|
||||
|
||||
if (customizeWorkshopGroupSettings.MainGroup)
|
||||
{
|
||||
var createDefaultEmployee = CreateEmployeeSettings(command);
|
||||
return createDefaultEmployee;
|
||||
}
|
||||
{
|
||||
var createDefaultEmployee = CreateEmployeeSettings(command);
|
||||
return createDefaultEmployee;
|
||||
}
|
||||
|
||||
|
||||
List<CustomizeWorkshopEmployeeSettingsShift> shiftCollection = new List<CustomizeWorkshopEmployeeSettingsShift>();
|
||||
@@ -558,13 +557,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
_customizeWorkshopEmployeeSettingsRepository.Create(entity);
|
||||
|
||||
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.FridayWork, command.HolidayWork, rotatingShift);
|
||||
var employeeSalary = command.Salary?.MoneyToDouble() ?? 0;
|
||||
|
||||
if (employeeSalary > 0)
|
||||
{
|
||||
entity.SetSalary(employeeSalary);
|
||||
}
|
||||
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.FridayWork, command.HolidayWork, rotatingShift);
|
||||
|
||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -688,7 +681,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult EditSimpleRollCallGroupSetting(EditCustomizeWorkshopGroupSettings command,
|
||||
List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
@@ -719,15 +712,15 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
{
|
||||
|
||||
groupSettingsShifts = command.ShiftViewModel.Select(x =>
|
||||
{
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new InvalidDataException();
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new InvalidDataException();
|
||||
{
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new InvalidDataException();
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new InvalidDataException();
|
||||
|
||||
return new CustomizeWorkshopGroupSettingsShift(start, end, x.Placement);
|
||||
return new CustomizeWorkshopGroupSettingsShift(start, end, x.Placement);
|
||||
|
||||
}).ToList();
|
||||
}).ToList();
|
||||
|
||||
if (groupSettingsShifts.All(x => workshopSettings.CustomizeWorkshopSettingsShifts.Any(y => x.Equals(y)))
|
||||
&& command.WorkshopShiftStatus == workshopSettings.WorkshopShiftStatus && command.FridayWork == workshopSettings.FridayWork &&
|
||||
@@ -1596,6 +1589,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return _customizeWorkshopGroupSettingsRepository.GetEmployeesGroupSettingsByEmployeeId(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public bool HasAnyEmployeeWithoutGroup(long workshopId)
|
||||
{
|
||||
return _customizeWorkshopGroupSettingsRepository.HasAnyEmployeeWithoutGroup(workshopId);
|
||||
}
|
||||
public OperationResult<List<long>> ValidateReCalculateValueForGroupEdit(List<ReCalculateRollCallValues> commands,
|
||||
long workshopId)
|
||||
{
|
||||
@@ -1626,16 +1623,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
employeeIdsHasCheckout = employeeIdsHasCheckout.Distinct().ToList();
|
||||
return isSuccess ?
|
||||
operationResult.Succcedded(employeeIdsHasCheckout)
|
||||
operationResult.Succcedded(employeeIdsHasCheckout)
|
||||
:
|
||||
operationResult.Failed("پرسنل هایی دارای فیش هستند لطفا نسبت به تعیین تکلیف این ها اقدام نمایید", employeeIdsHasCheckout);
|
||||
}
|
||||
|
||||
public bool HasAnyEmployeeWithoutGroup(long workshopId)
|
||||
{
|
||||
return _customizeWorkshopGroupSettingsRepository.HasAnyEmployeeWithoutGroup(workshopId);
|
||||
}
|
||||
|
||||
public bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
return _customizeWorkshopEmployeeSettingsRepository.CheckEmployeeShiftHasChanged(command);
|
||||
|
||||
@@ -1,38 +1,36 @@
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeInsuranceRecord;
|
||||
using CompanyManagment.EFCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.EmployeeInsuranceRecord;
|
||||
using Company.Domain.EmployeeInsuranceRecordAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
using EmployeeInsuranceRecord = Company.Domain.EmployeeInsuranceRecordAgg.EmployeeInsuranceRecord;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System.IO;
|
||||
using _0_Framework.Application.UID;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.EmployeeDocumentsAgg;
|
||||
using Company.Domain.LeftWorkTempAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
||||
using CompanyManagment.App.Contracts.EmployeeDocuments;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
using RollCallEmployee = Company.Domain.RollCallEmployeeAgg.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System.IO;
|
||||
using System.Transactions;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using Company.Domain.LeftWorkTempAgg;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using System.Reflection;
|
||||
using _0_Framework.Application.UID;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.EmployeeDocumentsAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.RollCallServiceAgg;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Company.Domain.LeftWorkInsuranceAgg;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -40,9 +38,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
private readonly IEmployeeRepository _EmployeeRepository;
|
||||
private readonly IWorkshopRepository _WorkShopRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly CompanyContext _context;
|
||||
public bool nationalCodValid = false;
|
||||
public bool idnumberIsOk = true;
|
||||
@@ -60,25 +55,17 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly ILeftWorkTempRepository _leftWorkTempRepository;
|
||||
private readonly IUidService _uidService;
|
||||
private readonly ICustomizeWorkshopEmployeeSettingsRepository _customizeWorkshopEmployeeSettingsRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
|
||||
private readonly IRollCallServiceRepository _rollCallServiceRepository;
|
||||
private readonly ILeftWorkInsuranceRepository _leftWorkInsuranceRepository ;
|
||||
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository,
|
||||
ILeftWorkRepository leftWorkRepository, IPersonnelCodeRepository personnelCodeRepository,
|
||||
IEmployeeClientTempRepository employeeClientTempRepository, IWebHostEnvironment webHostEnvironment,
|
||||
IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository,
|
||||
ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository,
|
||||
ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication,
|
||||
IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository,
|
||||
IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository,
|
||||
IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository, IRollCallServiceRepository rollCallServiceRepository) : 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;
|
||||
_WorkShopRepository = workShopRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
this._leftWorkRepository = leftWorkRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
@@ -88,15 +75,19 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_leftWorkTempRepository = leftWorkTempRepository;
|
||||
_uidService = uidService;
|
||||
_customizeWorkshopEmployeeSettingsRepository = customizeWorkshopEmployeeSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
|
||||
_rollCallServiceRepository = rollCallServiceRepository;
|
||||
_leftWorkInsuranceRepository = leftWorkInsuranceRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateEmployee command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
if (_EmployeeRepository.Exists(x =>
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.NationalCode != null))
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.NationalCode != null && x.IsActiveString == "true"))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
//if (_EmployeeRepository.Exists(x => x.IdNumber == command.IdNumber && x.IdNumber !=null))
|
||||
@@ -114,7 +105,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
if (command.Address != null && command.State == null)
|
||||
{
|
||||
@@ -153,8 +144,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -206,9 +197,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.DateOfBirth != null ? command.DateOfBirth.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue != null ? command.DateOfIssue.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
@@ -233,10 +224,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
return opration.Succcedded(employeeData.id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public OperationResult Edit(EditEmployee command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
@@ -245,11 +235,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_EmployeeRepository.Exists(x =>
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.id != command.Id))
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.id != command.Id && x.IsActiveString == "true"))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
//if (_EmployeeRepository.Exists(x => x.IdNumber == command.IdNumber && x.IdNumber != null && x.id != command.Id))
|
||||
// return opration.Failed("شماره شناسنامه وارد شده تکراری است");
|
||||
|
||||
|
||||
if (command.Address != null && command.State == null)
|
||||
{
|
||||
StatCity = false;
|
||||
@@ -287,8 +277,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -341,7 +331,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.DateOfBirth != null ? command.DateOfBirth.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue != null ? command.DateOfIssue.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
@@ -349,7 +339,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
dateOfIssue,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,
|
||||
command.Phone, command.Address,
|
||||
command.State, command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.State,command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.FieldOfStudy, command.BankCardNumber,
|
||||
command.BankBranch, command.InsuranceCode, command.InsuranceHistoryByYear,
|
||||
command.InsuranceHistoryByMonth, command.NumberOfChildren, command.OfficePhone
|
||||
@@ -362,7 +352,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public EditEmployee GetDetails(long id)
|
||||
@@ -370,11 +360,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return _EmployeeRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public EditEmployee GetDetailsIgnoreQueryFilter(long id)
|
||||
{
|
||||
return _EmployeeRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
@@ -413,8 +398,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
public async Task<List<EmployeeViewModel>> Search(EmployeeSearchModel searchModel)
|
||||
{
|
||||
var res = await _EmployeeRepository.Search(searchModel);
|
||||
|
||||
var res=await _EmployeeRepository.Search(searchModel);
|
||||
|
||||
foreach (var item in res)
|
||||
{
|
||||
var children = _context.EmployeeChildrenSet.Count(x => x.EmployeeId == item.Id);
|
||||
@@ -705,8 +690,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -835,8 +820,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -916,17 +901,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Pooya
|
||||
|
||||
|
||||
public List<EmployeeViewModel> GetWorkingEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _EmployeeRepository.GetWorkingEmployeesByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
public EmployeeViewModel GetEmployeeByNationalCodeIfHasActiveLeftWork(string nationalCode, List<long> workshopIds)
|
||||
{
|
||||
if (nationalCode.NationalCodeValid() != "valid")
|
||||
@@ -934,6 +913,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var workshopEmployeesWithLeftWork = _EmployeeRepository.GetWorkingEmployeesByWorkshopIdsAndNationalCodeAndDate(workshopIds, nationalCode, DateTime.Now.Date);
|
||||
return workshopEmployeesWithLeftWork.FirstOrDefault();
|
||||
}
|
||||
|
||||
public EmployeeViewModel GetEmployeeByNationalCodeIfHasLeftWork(string nationalCode, List<long> workshopIds)
|
||||
{
|
||||
if (nationalCode.NationalCodeValid() != "valid")
|
||||
@@ -941,8 +921,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var workshopEmployeesWithLeftWork = _EmployeeRepository.GetWorkedEmployeesByWorkshopIdsAndNationalCodeAndDate(workshopIds, nationalCode, DateTime.Now.Date);
|
||||
return workshopEmployeesWithLeftWork.FirstOrDefault();
|
||||
}
|
||||
public List<EmployeeViewModel> GetWorkingEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _EmployeeRepository.GetWorkingEmployeesByWorkshopId(workshopId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<EmployeeViewModel> GetRangeByIds(IEnumerable<long> employeeIds)
|
||||
{
|
||||
@@ -978,7 +961,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
@@ -1030,7 +1012,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var startLeftWork = command.StartLeftWork.ToGeorgianDateTime();
|
||||
|
||||
var leftWorkViewModel = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id);
|
||||
PersonnelCodeDomain personnelCode = null;
|
||||
|
||||
|
||||
PersonnelCodeDomain personnelCode = null;
|
||||
if (leftWorkViewModel != null)
|
||||
{
|
||||
if (leftWorkViewModel.HasLeft == false && leftWorkViewModel.LeftWorkDate > DateTime.Now)
|
||||
@@ -1045,10 +1029,16 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}
|
||||
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,
|
||||
employee.id, lastPersonnelCodeByWorkshop + 1);
|
||||
personnelCode = new PersonnelCodeDomain(command.WorkshopId,
|
||||
employee.id, lastPersonnelCodeByWorkshop + 1);
|
||||
}
|
||||
}
|
||||
|
||||
var leftWorkTemp = LeftWorkTemp.CreateStartWork(command.WorkshopId, employee.id, startLeftWork, command.JobId);
|
||||
@@ -1062,7 +1052,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_personnelCodeRepository.SaveChanges();
|
||||
}
|
||||
|
||||
var rollCallService = _rollCallServiceRepository.GetActiveServiceByWorkshopId(command.WorkshopId);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.RollCallUploadEmployeePicture?.Picture1) == false &&
|
||||
string.IsNullOrWhiteSpace(command.RollCallUploadEmployeePicture?.Picture2) == false)
|
||||
@@ -1072,14 +1061,14 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
|
||||
var filePath1 = Path.Combine(directoryPath) + $@"\1.jpg";
|
||||
|
||||
CreateImageFromBase64(command.RollCallUploadEmployeePicture.Picture1, filePath1);
|
||||
|
||||
|
||||
CreateImageFromBase64(command.RollCallUploadEmployeePicture.Picture1, filePath1);
|
||||
|
||||
|
||||
var filePath2 = Path.Combine(directoryPath) + $@"\2.jpg";
|
||||
|
||||
CreateImageFromBase64(command.RollCallUploadEmployeePicture.Picture2, filePath2);
|
||||
|
||||
|
||||
CreateImageFromBase64(command.RollCallUploadEmployeePicture.Picture2, filePath2);
|
||||
|
||||
|
||||
|
||||
var rollCallEmployee =
|
||||
@@ -1112,16 +1101,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
if (command.CreateCustomizeEmployeeSettings.GroupId > 0)
|
||||
{
|
||||
if (rollCallService?.HasCustomizeCheckoutService == "true")
|
||||
{
|
||||
var employeeSalary = command.CreateCustomizeEmployeeSettings.Salary?.MoneyToDouble() ?? 0;
|
||||
|
||||
if (employeeSalary < 1)
|
||||
{
|
||||
return op.Failed("لطفا حقوق پرسنل را وارد کنید");
|
||||
}
|
||||
|
||||
}
|
||||
if (_customizeWorkshopEmployeeSettingsRepository
|
||||
.Exists(x => x.WorkshopId == workshop.Id && x.EmployeeId == employee.id))
|
||||
{
|
||||
@@ -1149,16 +1128,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}
|
||||
else if (command.CreateCustomizeEmployeeSettings.GroupId > 0)
|
||||
{
|
||||
if (rollCallService?.HasCustomizeCheckoutService == "true")
|
||||
{
|
||||
var employeeSalary = command.CreateCustomizeEmployeeSettings.Salary?.MoneyToDouble() ?? 0;
|
||||
|
||||
if (employeeSalary < 1)
|
||||
{
|
||||
return op.Failed("لطفا حقوق پرسنل را وارد کنید");
|
||||
}
|
||||
|
||||
}
|
||||
if (_customizeWorkshopEmployeeSettingsRepository
|
||||
.Exists(x => x.WorkshopId == workshop.Id && x.EmployeeId == employee.id))
|
||||
{
|
||||
@@ -1252,7 +1221,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
byte[] bytes = Convert.FromBase64String(subBase64);
|
||||
System.IO.File.WriteAllBytes(filePath, bytes);
|
||||
}
|
||||
|
||||
public async Task<OperationResult<EmployeeByNationalCodeInWorkshopViewModel>>
|
||||
ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(string nationalCode, string birthDate, long workshopId)
|
||||
{
|
||||
@@ -1542,9 +1510,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
employee.EditAuthorizeEmployee(employee.DateOfIssue, employee.PlaceOfIssue,
|
||||
employee.Phone, employee.Address, employee.State, employee.City, command.MaritalStatus,
|
||||
command.MilitaryService, employee.LevelOfEducation, employee.FieldOfStudy,
|
||||
command.MilitaryService, employee.LevelOfEducation, employee.FieldOfStudy,
|
||||
employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode,
|
||||
employee.InsuranceHistoryByYear, employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.InsuranceHistoryByYear, employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
@@ -1658,5 +1626,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -17,204 +17,206 @@ namespace CompanyManagment.Application;
|
||||
|
||||
public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
||||
{
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCallEmployee command)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
public OperationResult Create(CreateRollCallEmployee command)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
|
||||
if (_rollCallEmployeeRepository.Exists(x =>
|
||||
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.EmployeeId))
|
||||
return opreation.Succcedded();
|
||||
var fullname = _employeeRepository.GetDetails(command.EmployeeId);
|
||||
if (fullname == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
if (_rollCallEmployeeRepository.Exists(x =>
|
||||
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.EmployeeId))
|
||||
return opreation.Succcedded();
|
||||
var fullname = _employeeRepository.GetDetails(command.EmployeeId);
|
||||
if (fullname == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
var create = new RollCallEmployee(command.WorkshopId, command.EmployeeId, fullname.FName, fullname.LName);
|
||||
_rollCallEmployeeRepository.Create(create);
|
||||
|
||||
if (command.HasUploadedImage == "true")
|
||||
create.HasImage();
|
||||
if (command.HasUploadedImage == "true")
|
||||
create.HasImage();
|
||||
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return opreation.Succcedded(create.id);
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return opreation.Succcedded(create.id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
|
||||
var emp = _rollCallEmployeeRepository.Get(id);
|
||||
var emp = _rollCallEmployeeRepository.Get(id);
|
||||
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
|
||||
if (!_leftWorkRepository.Exists(x => x.EmployeeId == emp.EmployeeId && x.WorkshopId == emp.WorkshopId &&
|
||||
x.StartWorkDate <= DateTime.Now && x.LeftWorkDate > DateTime.Now))
|
||||
return opreation.Failed("کارمند شروع به کار ندارد");
|
||||
if (!_leftWorkRepository.Exists(x => x.EmployeeId == emp.EmployeeId && x.WorkshopId == emp.WorkshopId &&
|
||||
x.StartWorkDate <= DateTime.Now && x.LeftWorkDate > DateTime.Now))
|
||||
return opreation.Failed("کارمند شروع به کار ندارد");
|
||||
|
||||
if (emp.HasUploadedImage == "false")
|
||||
return opreation.Failed("لطفا ابتدا عکس پرسنل را آپلود کنید");
|
||||
if (emp.HasUploadedImage == "false")
|
||||
return opreation.Failed("لطفا ابتدا عکس پرسنل را آپلود کنید");
|
||||
|
||||
using var transaction = new TransactionScope();
|
||||
using var transaction = new TransactionScope();
|
||||
|
||||
emp.Active();
|
||||
|
||||
var operation2 = _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() { RollCallEmployeeId = id });
|
||||
if (operation2.IsSuccedded == false)
|
||||
return operation2;
|
||||
|
||||
var operation2 = _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() { RollCallEmployeeId = id });
|
||||
if (operation2.IsSuccedded == false)
|
||||
return operation2;
|
||||
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
transaction.Complete();
|
||||
|
||||
return operation2;
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResult DeActive(long id)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetWithRollCallStatus(id);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
var lastStatus = emp.EmployeesStatus.MaxBy(x => x.StartDate);
|
||||
emp.DeActive();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
_rollCallEmployeeStatusApplication.Deactivate(lastStatus.id);
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
public OperationResult DeActive(long id)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetWithRollCallStatus(id);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
var lastStatus = emp.EmployeesStatus.MaxBy(x => x.StartDate);
|
||||
emp.DeActive();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
_rollCallEmployeeStatusApplication.Deactivate(lastStatus.id);
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult UploadedImage(long Employeeid, long WorkshopId)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
public OperationResult UploadedImage(long Employeeid, long WorkshopId)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
|
||||
var rollCall = _rollCallEmployeeRepository.Get(emp.Id);
|
||||
rollCall.HasImage();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", WorkshopId.ToString(), Employeeid.ToString());
|
||||
var thumbnailPath = Path.Combine(path, "Thumbnail.jpg");
|
||||
try
|
||||
{
|
||||
var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150);
|
||||
System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
var rollCall = _rollCallEmployeeRepository.Get(emp.Id);
|
||||
rollCall.HasImage();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", WorkshopId.ToString(), Employeeid.ToString());
|
||||
var thumbnailPath = Path.Combine(path, "Thumbnail.jpg");
|
||||
try
|
||||
{
|
||||
var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150);
|
||||
System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetByWorkshopId(workshopId);
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
public EditRollCallEmployee GetDetails(long id)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetDetails(id);
|
||||
}
|
||||
public EditRollCallEmployee GetDetails(long id)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
}
|
||||
public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListPaginate(RollCallEmployeeSearchModel command)
|
||||
{
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListPaginate(RollCallEmployeeSearchModel command)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetPersonnelRollCallListPaginate(command);
|
||||
}
|
||||
|
||||
public int activedPerson(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.activedPerson(workshopId);
|
||||
}
|
||||
public int activedPerson(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.activedPerson(workshopId);
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
public List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetRollCallEmployeesByWorkshopId(workshopId);
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
}
|
||||
#region Pooya
|
||||
public List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetRollCallEmployeesByWorkshopId(workshopId);
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
|
||||
public bool IsEmployeeRollCallActive(long employeeId, long workshopId)
|
||||
{
|
||||
RollCallEmployeeViewModel rollCallEmployee = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
if (rollCallEmployee == null || rollCallEmployee.IsActiveString != "true" || rollCallEmployee.HasUploadedImage != "true")
|
||||
return false;
|
||||
var now = DateTime.Now;
|
||||
return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
|
||||
}
|
||||
|
||||
public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActiveAndDeActiveRollCallEmployees(workshopId);
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetPersonnelRollCallListAll(workshopId);
|
||||
}
|
||||
|
||||
public bool HasEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.HasEmployees(workshopId);
|
||||
}
|
||||
|
||||
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
|
||||
{
|
||||
OperationResult result = new();
|
||||
if (string.IsNullOrWhiteSpace(lName) || string.IsNullOrWhiteSpace(fName))
|
||||
return result.Failed("نام و نام خانوادگی نمی توانند خالی باشند");
|
||||
fName = fName.Trim();
|
||||
lName = lName.Trim();
|
||||
var fullName = $"{fName} {lName}";
|
||||
var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId);
|
||||
public bool IsEmployeeRollCallActive(long employeeId, long workshopId)
|
||||
{
|
||||
RollCallEmployeeViewModel rollCallEmployee = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
if (rollCallEmployee == null || rollCallEmployee.IsActiveString != "true" || rollCallEmployee.HasUploadedImage != "true")
|
||||
return false;
|
||||
var now = DateTime.Now;
|
||||
return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now);
|
||||
|
||||
|
||||
if (entity == null)
|
||||
return result.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
if (_rollCallEmployeeRepository.Exists(x => x.WorkshopId == entity.WorkshopId && x.EmployeeFullName == fullName && x.id != rollCallEmployeeId))
|
||||
return result.Failed("نام و نام خانوادگی کارمند نمی تواند با نام و نام خانوادگی کارمند دیگری در آن کارگاه یکسان باشد");
|
||||
}
|
||||
|
||||
if (entity.IsActiveString != "true")
|
||||
return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد");
|
||||
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
|
||||
}
|
||||
|
||||
public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActiveAndDeActiveRollCallEmployees(workshopId);
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetPersonnelRollCallListAll(workshopId);
|
||||
}
|
||||
|
||||
public bool HasEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.HasEmployees(workshopId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
|
||||
{
|
||||
OperationResult result = new();
|
||||
if (string.IsNullOrWhiteSpace(lName) || string.IsNullOrWhiteSpace(fName))
|
||||
return result.Failed("نام و نام خانوادگی نمی توانند خالی باشند");
|
||||
fName = fName.Trim();
|
||||
lName = lName.Trim();
|
||||
var fullName = $"{fName} {lName}";
|
||||
var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId);
|
||||
|
||||
|
||||
entity.ChangeName(fName, lName);
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return result.Succcedded();
|
||||
}
|
||||
if (entity == null)
|
||||
return result.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
if (_rollCallEmployeeRepository.Exists(x => x.WorkshopId == entity.WorkshopId && x.EmployeeFullName == fullName && x.id != rollCallEmployeeId))
|
||||
return result.Failed("نام و نام خانوادگی کارمند نمی تواند با نام و نام خانوادگی کارمند دیگری در آن کارگاه یکسان باشد");
|
||||
|
||||
if (entity.IsActiveString != "true")
|
||||
return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد");
|
||||
|
||||
|
||||
entity.ChangeName(fName, lName);
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return result.Succcedded();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -89,60 +89,9 @@ namespace CompanyManagment.Application
|
||||
}
|
||||
|
||||
public bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
//موقت
|
||||
// دادمهرگستر 11 *
|
||||
//585 کاشی گالری سرامیس (بابک ابراهیمی )
|
||||
//آموزشگاه ملل 604 *
|
||||
//کاریابی ملل 605 *
|
||||
//368 پیتزا امیر آماده سازی
|
||||
//367 پیتزا امیر رستوران
|
||||
//286 مرکز توان بخشی رسالت *
|
||||
//610 بیمارستان پارس - رازقی طعام
|
||||
DateTime start1404 = new DateTime(2025, 03, 21);
|
||||
bool skipRollCallByWorkshopId = false;
|
||||
if (contractStart < start1404)
|
||||
{
|
||||
skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367 or 286;
|
||||
}
|
||||
else
|
||||
{
|
||||
skipRollCallByWorkshopId = workshopId is 368 or 367 or 585 or 610;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//#if DEBUG
|
||||
// skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367;
|
||||
//#endif
|
||||
if (skipRollCallByWorkshopId)
|
||||
return false;
|
||||
|
||||
|
||||
// 42550 مصطفی مقدس نژاد فومنی
|
||||
bool skipRollCallByEmployeeId = employeeId is 42550;
|
||||
if (skipRollCallByEmployeeId)
|
||||
return false;
|
||||
|
||||
//9211 محسا تازه
|
||||
if (employeeId == 9211 && contractStart >= start1404)
|
||||
return false;
|
||||
|
||||
var service = _rollCallServiceRepository.GetAllServiceByWorkshopId(workshopId);
|
||||
|
||||
if (!service.Any(x => x.StartService.Date <= contractStart.Date && x.EndService.Date >= contractEnd.Date))
|
||||
return false;
|
||||
var rollCallEmployee =
|
||||
_rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
|
||||
if (rollCallEmployee == null)
|
||||
return false;
|
||||
|
||||
return _employeeRollCallStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id &&
|
||||
x.StartDate.Date <= contractStart.Date &&
|
||||
x.EndDate.Date >= contractEnd.Date);
|
||||
}
|
||||
{
|
||||
return _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr)
|
||||
{
|
||||
@@ -185,5 +134,38 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
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();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
return op.Failed("شماره همراه نا معتبر است");
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -141,8 +141,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
result.FName = createTemp.FName;
|
||||
result.LName = createTemp.LName;
|
||||
result.DateOfBirthFa = dateOfBirth;
|
||||
result.FatherName = createTemp.FatherName;
|
||||
result.IdNumberSerial = createTemp.IdNumberSerial;
|
||||
result.IdNumber = idNumber;
|
||||
|
||||
return op.Succcedded(result);
|
||||
@@ -190,7 +188,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId)
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var updateWorkshopList = command.Where(x => x.Id > 0).ToList();
|
||||
@@ -198,17 +196,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
if (updateWorkshopList.Count == 0 && createNewWorkshopList.Count == 0)
|
||||
return op.Failed("هیچ مجموعه ای ایجاد نشده است");
|
||||
var oldWorkshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
#region Update
|
||||
if (updateWorkshopList.Count > 0)
|
||||
{
|
||||
var updateListIds = updateWorkshopList.Select(x => x.Id).ToList();
|
||||
var oldWorkshopsIds = oldWorkshops.Select(x => x.Id).ToList();
|
||||
var exceptWorkshops = oldWorkshopsIds.Except(updateListIds).ToList();
|
||||
if (exceptWorkshops.Any())
|
||||
await _workshopTempRepository.RemoveWorkshopTemps(exceptWorkshops);
|
||||
|
||||
|
||||
foreach (var workshop in updateWorkshopList)
|
||||
{
|
||||
@@ -221,7 +212,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
workshop.RollCall == false && workshop.Insurance == false)
|
||||
op.Failed($"برای مجموعه {workshop.WorkshopName} هیچ سرویسی انتخاب نشده است");
|
||||
var existWorkshops = _workshopTempRepository.Get(workshop.Id);
|
||||
|
||||
if (existWorkshops != null)
|
||||
{
|
||||
if (workshop.ContractAndCheckout)
|
||||
@@ -266,8 +256,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, workshop.Id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -336,8 +324,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -366,9 +352,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth")
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime")
|
||||
{
|
||||
|
||||
//دریافت کارگاه ها
|
||||
var workshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
@@ -395,10 +380,9 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_ => 12,
|
||||
};
|
||||
//رند کردن مبالغ کارگاه ها
|
||||
var roundAmount = (((Convert.ToInt64(totalPayment1MonthDouble))) / 1000000) * 1000000;
|
||||
double roundAmount2 = roundAmount;
|
||||
var roundAmount = (int)(totalPayment1MonthDouble / 1000000) * 1000000;
|
||||
//بدست آوردن جمع کل مبالغ کارگاه بر اساس مدت قراداد
|
||||
result.SumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
result.SumOfWorkshopsPaymentDouble = roundAmount * months;
|
||||
result.SumOfWorkshopsPaymentPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
|
||||
@@ -410,112 +394,31 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//مالیات
|
||||
result.ValueAddedTaxDouble = tenPercent;
|
||||
result.ValueAddedTaxSt = tenPercent.ToMoney();
|
||||
//پرداخت یکجا
|
||||
#region OneTimePaymentResult
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.OneTimeWithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.OneTimeWithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.OneTimeTotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.OneTimeTotalPaymentStr = result.OneTimeTotalPaymentDouble.ToMoney();
|
||||
|
||||
#endregion
|
||||
|
||||
//پرداخت ماهیانه
|
||||
#region MonthlyPaymentResult
|
||||
|
||||
//مبلغ بدون مالیات
|
||||
result.MonthlyWithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.MonthlyWithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.MonthlyTotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.MonthlyTotalPaymentStr = result.MonthlyTotalPaymentDouble.ToMoney();
|
||||
var installmentList = new List<MonthlyInstallment>();
|
||||
|
||||
var startDate = (DateTime.Now).ToFarsi();
|
||||
result.ContractStartCurrentMonthFa = $"{startDate.Substring(0, 8)}01";
|
||||
result.ContractStartCurrentMonthGr = result.ContractStartCurrentMonthFa.ToGeorgianDateTime();
|
||||
startDate = result.ContractStartCurrentMonthFa;
|
||||
|
||||
result.ContractStartNextMonthGr = ((startDate.FindeEndOfMonth()).ToGeorgianDateTime()).AddDays(1);
|
||||
result.ContractStartNextMonthFa = result.ContractStartNextMonthGr.ToFarsi();
|
||||
|
||||
if (contractStartType == "nextMonth")
|
||||
startDate = result.ContractStartNextMonthFa;
|
||||
|
||||
|
||||
|
||||
var findeEnd = Tools.FindEndOfContract(startDate, periodModel);
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
result.ContractEndGr = contractEndDate;
|
||||
result.ContractEndFa = contractEndDate.ToFarsi();
|
||||
|
||||
if (periodModel == "1")
|
||||
if (paymentModel == "OneTime")//تخفیف 10 درصدی درصورت پرداخت یکجا
|
||||
{
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = result.MonthlyTotalPaymentStr,
|
||||
InstallmentCounter = "سررسید پرداخت اول",
|
||||
InstalmentDate = (DateTime.Now).ToFarsi()
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
});
|
||||
result.MonthlyInstallments = installmentList;
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.WithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.WithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.TotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
else
|
||||
{
|
||||
int instalmentCount = Convert.ToInt32(periodModel);
|
||||
var instalmentAmount = result.MonthlyTotalPaymentDouble / instalmentCount;
|
||||
var findEndOfMonth = startDate.FindeEndOfMonth();
|
||||
for (int i = 1; i <= instalmentCount; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
{
|
||||
startDate = (DateTime.Now).ToFarsi();
|
||||
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
var currentMonthStart = ((findEndOfMonth.ToGeorgianDateTime()).AddDays(1)).ToFarsi();
|
||||
startDate = currentMonthStart.FindeEndOfMonth();
|
||||
findEndOfMonth = startDate;
|
||||
}
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = instalmentAmount.ToMoney(),
|
||||
InstallmentCounter = i switch
|
||||
{
|
||||
1 => "سررسید پرداخت اول",
|
||||
2 => "سررسید پرداخت دوم",
|
||||
3 => "سررسید پرداخت سوم",
|
||||
4 => "سررسید پرداخت چهارم",
|
||||
5 => "سررسید پرداخت پنجم",
|
||||
6 => "سررسید پرداخت ششم",
|
||||
7 => "سررسید پرداخت هفتم",
|
||||
8 => "سررسید پرداخت هشتم",
|
||||
9 => "سررسید پرداخت نهم",
|
||||
10 => "سررسید پرداخت دهم",
|
||||
11 => "سررسید پرداخت یازدهم",
|
||||
12 => "سررسید پرداخت دوازدهم",
|
||||
_ => "سررسید پرداخت دوازدهم",
|
||||
},
|
||||
InstalmentDate = startDate
|
||||
|
||||
});
|
||||
}
|
||||
//مبلغ بدون مالیات
|
||||
result.WithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.WithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.TotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
result.MonthlyInstallments = installmentList;
|
||||
result.ContractingPartTempId = contractingPartyTempId;
|
||||
|
||||
return result;
|
||||
@@ -527,21 +430,19 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart)
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax)
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
var contractStartDate = contractStart;
|
||||
string contractStartFa = contractStart.ToFarsi();
|
||||
var findeEnd = Tools.FindEndOfContract(contractStartFa, periodModel);
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
|
||||
if (institutionContractTemp == null)
|
||||
{
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId,paymentModel,periodModel,totalPayment,contractstart,contractEnd,"official", valueAddedTax,"", "BeforeSendVerifyCode", 0,null,null);
|
||||
_institutionContractTempRepository.Create(create);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -550,20 +451,20 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
if (institutionContractTemp.VerifyCodeEndTime != null)
|
||||
{
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent" && spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
}
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "Completed")
|
||||
return op.Failed("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
|
||||
|
||||
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractstart, contractEnd, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -582,14 +483,14 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
var institutionContractTemp = await
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خطا");
|
||||
return op.Failed("خظا");
|
||||
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "BeforeSendVerifyCode")
|
||||
@@ -615,29 +516,26 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent")
|
||||
|
||||
{
|
||||
|
||||
if (DateTime.Now < institutionContractTemp.VerifyCodeEndTime.Value)
|
||||
return op.Failed("کد دریافت شده را وارد کنید");
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
|
||||
if ((spaning > new TimeSpan(0, 1, 0)))
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning > new TimeSpan(0, 1, 0)))
|
||||
{
|
||||
//ساخت کد شش رقمی
|
||||
Random generator = new Random();
|
||||
String code = generator.Next(1, 1000000).ToString("D6");
|
||||
//ارسال اس ام اس
|
||||
var getContractingPaty = _contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
var sendResult = await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
var sendResult =await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
|
||||
if (!sendResult.IsSuccedded)
|
||||
if(!sendResult.IsSuccedded)
|
||||
return op.Failed($"{sendResult.Message}");
|
||||
|
||||
|
||||
@@ -646,16 +544,16 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//ذخیره تاریخ ارسال و مهلت پایان
|
||||
//ذخیره آیدی پیامک
|
||||
//تغییر وضعیت به ارسال شده
|
||||
|
||||
|
||||
if (update != null)
|
||||
{
|
||||
update.Update(code, "VerifyCodeSent", sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
update.Update(code, "VerifyCodeSent",sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -682,25 +580,25 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خظا");
|
||||
if (institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
if(institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
return op.Failed("خطا");
|
||||
|
||||
if (institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
if(institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
return op.Failed("کد شما منقضی شده است");
|
||||
|
||||
if (institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
if(institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
{
|
||||
if (institutionContractTemp.VerifyCode == verifyCode)
|
||||
{
|
||||
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
return op.Failed("کد وارد شده صحیح نیست");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.ClassifiedSalaryAgg;
|
||||
using Company.Domain.ClientEmployeeWorkshopAgg;
|
||||
using Company.Domain.Contact2Agg;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractAgg;
|
||||
using Company.Domain.ContractingPartyAccountAgg;
|
||||
@@ -176,8 +175,6 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<EmployeeClientTemp> EmployeeClientTemps { get; set; }
|
||||
public DbSet<LeftWorkTemp> LeftWorkTemps { get; set; }
|
||||
public DbSet<ContactUs> ContactUs { get; set; }
|
||||
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
public DbSet<AdminMonthlyOverview> AdminMonthlyOverviews { get; set; }
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class ContactUsMapping:IEntityTypeConfiguration<ContactUs>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ContactUs> builder)
|
||||
{
|
||||
builder.HasKey(x => x.id);
|
||||
builder.Property(x => x.FullName).HasMaxLength(200);
|
||||
builder.Property(x => x.Title).HasMaxLength(200);
|
||||
builder.Property(x => x.Email).HasMaxLength(200);
|
||||
builder.Property(x => x.FirstName).HasMaxLength(100);
|
||||
builder.Property(x => x.LastName).HasMaxLength(100);
|
||||
builder.Property(x => x.Message).HasMaxLength(500);
|
||||
builder.Property(x => x.PhoneNumber).HasMaxLength(20);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class PersonalContractingpartyMapping : IEntityTypeConfiguration<Personal
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(15);
|
||||
builder.Property(x => x.FatherName).HasMaxLength(20);
|
||||
builder.Property(x => x.DateOfBirth).IsRequired(false);
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
v => v.ToString(),
|
||||
v => string.IsNullOrWhiteSpace(v) ? Gender.None : (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addcontactus : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ContactUs",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FirstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
Title = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
Message = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
FullName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ContactUs", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ContactUs");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addsalaryAidcalculationdate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addsalaryAidcalculationdatetocustomizecheckouts : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -559,50 +559,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("TextManager_Contact", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContactUsAgg.ContactUs", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("ContactUs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
|
||||
@@ -10,265 +10,340 @@ using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Tools = _0_Framework_b.Application.Tools;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyOverview>, IAdminMonthlyOverviewRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly AccountContext _accountContext;
|
||||
public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
_accountContext = accountContext;
|
||||
}
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly AccountContext _accountContext;
|
||||
public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
_accountContext = accountContext;
|
||||
}
|
||||
|
||||
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
|
||||
var year = searchModel.Year;
|
||||
var month = searchModel.Month;
|
||||
var accountId = searchModel.AdminAccountId;
|
||||
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
||||
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetDate) == false)
|
||||
return [];
|
||||
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
|
||||
// دریافت اطلاعات ادمین
|
||||
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
|
||||
|
||||
// اگر ادمین پیدا نشد، لیست خالی برگردان
|
||||
if (adminAccount == null)
|
||||
return [];
|
||||
|
||||
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
||||
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
||||
.Where(c => c.ContractStartGr <= targetDate && c.ContractEndGr >= targetDate && c.IsActiveString == "true")
|
||||
.Select(c => c.ContractingPartyId);
|
||||
|
||||
// دریافت کارگاههای مرتبط با اکانت
|
||||
var accountWorkshopIds = _companyContext.WorkshopAccounts
|
||||
.AsNoTracking()
|
||||
.Where(w => w.AccountId == accountId)
|
||||
.Select(w => w.WorkshopId);
|
||||
|
||||
// دریافت کارگاههای مربوط به طرف حساب و اکانت
|
||||
// Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty
|
||||
|
||||
|
||||
var year = searchModel.Year;
|
||||
var month = searchModel.Month;
|
||||
var accountId = searchModel.AdminAccountId;
|
||||
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
||||
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetStartDate) == false)
|
||||
return [];
|
||||
var targetEndDate = Tools.FindeEndOfMonth(targetStartDate.ToFarsi()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
|
||||
var workshopsWithContractingParty =await _companyContext.Workshops
|
||||
.AsNoTracking()
|
||||
.Where(w => accountWorkshopIds.Contains(w.id))
|
||||
.Include(w => w.WorkshopEmployers)
|
||||
.ThenInclude(we => we.Employer)
|
||||
.ThenInclude(e => e.ContractingParty).AsSplitQuery().
|
||||
Where(w => w.WorkshopEmployers.Any(we =>
|
||||
we.Employer != null &&
|
||||
contractingPartyIds.Contains(we.Employer.ContractingPartyId)))
|
||||
.Select(w => new
|
||||
{
|
||||
Workshop = w,
|
||||
ContractingParty = w.WorkshopEmployers
|
||||
.Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId))
|
||||
.Select(we => we.Employer.ContractingParty)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.ToListAsync();
|
||||
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextFirstMonth);
|
||||
var nextEndMonth = Tools.FindeEndOfMonth(nextFirstMonth.ToFarsi()).ToGeorgianDateTime();
|
||||
|
||||
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
|
||||
// پیدا کردن کارگاههایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
|
||||
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
|
||||
.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year)
|
||||
.Select(x => x.WorkshopId)
|
||||
.ToListAsync();
|
||||
// دریافت اطلاعات ادمین
|
||||
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
|
||||
|
||||
// پیدا کردن کارگاههایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند
|
||||
var notExistAdminMonthlyReviewsWorkshopIds = workshopIds
|
||||
.Except(adminMonthlyOverviewWorkshopIds)
|
||||
.ToList();
|
||||
// اگر ادمین پیدا نشد، لیست خالی برگردان
|
||||
if (adminAccount == null)
|
||||
return [];
|
||||
|
||||
|
||||
// ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند
|
||||
if (notExistAdminMonthlyReviewsWorkshopIds.Any())
|
||||
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
||||
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
||||
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
||||
.Where(c => c.ContractStartGr <= targetEndDate && c.ContractEndGr >= targetStartDate)
|
||||
.Select(c => c.ContractingPartyId);
|
||||
|
||||
// بهروزرسانی وضعیتها
|
||||
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds);
|
||||
// دریافت کارگاههای مرتبط با اکانت
|
||||
|
||||
if (searchModel.ActivationStatus != IsActive.None)
|
||||
{
|
||||
var isBlock = searchModel.ActivationStatus == IsActive.True ? "true" : "false";
|
||||
|
||||
workshopsWithContractingParty = workshopsWithContractingParty
|
||||
.Where(x => x.ContractingParty?.IsBlock == isBlock).ToList();
|
||||
|
||||
workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
}
|
||||
|
||||
// دریافت همه AdminMonthlyOverview برای این کارگاهها/ماه/سال
|
||||
var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year);
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList();
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId));
|
||||
}
|
||||
var workshopAccounts = _companyContext.WorkshopAccounts
|
||||
.AsNoTracking()
|
||||
.Where(w => w.AccountId == accountId)
|
||||
.Select(w => w.WorkshopId).ToList();
|
||||
|
||||
|
||||
|
||||
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
||||
var employeeCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate < targetDate && x.LeftWorkDate > targetDate && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
|
||||
var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x =>
|
||||
{
|
||||
var employeeCount = employeeCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var workshopWithContractingParty =
|
||||
workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId);
|
||||
|
||||
var workshop = workshopWithContractingParty?.Workshop;
|
||||
var contractingParty = workshopWithContractingParty?.ContractingParty;
|
||||
var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer;
|
||||
return new AdminMonthlyOverviewListViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Status = x.Status,
|
||||
Id = x.id,
|
||||
WorkshopName = workshop?.WorkshopFullName ?? "",
|
||||
WorkshopArchiveCode = workshop?.ArchiveCode ?? "",
|
||||
Address = workshop?.Address ?? "",
|
||||
City = workshop?.City ?? "",
|
||||
Province = workshop?.State ?? "",
|
||||
EmployerName = employer?.FullName ?? "",
|
||||
EmployerPhoneNumber = employer?.Phone ?? "",
|
||||
AdminFullName = adminAccount.Fullname,
|
||||
EmployeeCount = employeeCount?.EmployeeCounts ?? 0,
|
||||
AgentPhoneNumber = "",
|
||||
IsBlock = contractingParty?.IsBlock == "true"
|
||||
};
|
||||
}).OrderBy(x => x.IsBlock).ToList();
|
||||
|
||||
|
||||
return adminMonthlyOverviewList;
|
||||
}
|
||||
|
||||
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
|
||||
{
|
||||
var searchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
AdminAccountId = accountId,
|
||||
Month = month,
|
||||
Year = year
|
||||
};
|
||||
var list = await GetWorkshopStatus(searchModel);
|
||||
|
||||
var allCount = list.Count;
|
||||
var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived);
|
||||
var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted);
|
||||
var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress);
|
||||
var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
return new AdminMonthlyOverViewCounterVm
|
||||
{
|
||||
All = allCount,
|
||||
Archived = archivedCount,
|
||||
VisitPending = visitPendingCount,
|
||||
VisitInProgress = visitInProgressCount,
|
||||
VisitCompleted = visitCompleteCount,
|
||||
CreateDocument = createDocCount
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds)
|
||||
{
|
||||
var targetDate = $"{year:0000}/{month:00}/01".ToGeorgianDateTime();
|
||||
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextMonth);
|
||||
var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
|
||||
((x.StartWorkDate <= targetEndDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate)
|
||||
|| (x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
|
||||
|
||||
|
||||
var workingEmployeeIds = (await _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= targetDate && x.LeftWorkDate >= targetDate)
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync()).Distinct();
|
||||
|
||||
var contractSet = (await _companyContext.Contracts.AsNoTracking()
|
||||
.Where(x => x.ContarctStart <= nextMonth && x.ContractEnd >= nextMonth)
|
||||
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
||||
.Where(x => x.ContractStart <= targetDate && x.ContractEnd >= targetDate)
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopId, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
// دریافت کارگاههای مربوط به طرف حساب و اکانت
|
||||
// Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty
|
||||
var workshopsWithContractingParty = await _companyContext.Workshops
|
||||
.AsNoTracking()
|
||||
.Where(w => workshopsHasLeftWorkEmployees.Contains(w.id) && w.IsActive)
|
||||
.Include(w => w.WorkshopEmployers)
|
||||
.ThenInclude(we => we.Employer)
|
||||
.ThenInclude(e => e.ContractingParty).AsSplitQuery().
|
||||
Where(w => w.WorkshopEmployers.Any(we =>
|
||||
we.Employer != null &&
|
||||
contractingPartyIds.Contains(we.Employer.ContractingPartyId)))
|
||||
.Select(w => new
|
||||
{
|
||||
Workshop = w,
|
||||
ContractingParty = w.WorkshopEmployers
|
||||
.Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId))
|
||||
.Select(we => we.Employer.ContractingParty)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var grouped = workingEmployeeIds.GroupBy(x => x.WorkshopId).ToList();
|
||||
|
||||
var workshopsWithFullContracts = grouped
|
||||
.Where(g => g.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
|
||||
var workshopsWithFullCheckout = grouped
|
||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||
// پیدا کردن کارگاههایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
|
||||
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
|
||||
.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year)
|
||||
.Select(x => x.WorkshopId)
|
||||
.ToListAsync();
|
||||
|
||||
var notFullyCoveredWorkshops = grouped
|
||||
.Where(g => g.Any(emp =>
|
||||
!contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) ||
|
||||
!checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
// پیدا کردن کارگاههایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند
|
||||
var notExistAdminMonthlyReviewsWorkshopIds = workshopIds
|
||||
.Except(adminMonthlyOverviewWorkshopIds)
|
||||
.ToList();
|
||||
|
||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => x.Month == month && x.Year == year);
|
||||
|
||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
// ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند
|
||||
if (notExistAdminMonthlyReviewsWorkshopIds.Any())
|
||||
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending);
|
||||
// بهروزرسانی وضعیتها
|
||||
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetStartDate,targetEndDate, nextFirstMonth,nextEndMonth);
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
if (searchModel.ActivationStatus != IsActive.None)
|
||||
{
|
||||
var isBlock = searchModel.ActivationStatus == IsActive.True ? "false" : "true";
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
workshopsWithContractingParty = workshopsWithContractingParty
|
||||
.Where(x => x.ContractingParty?.IsBlock == isBlock).ToList();
|
||||
|
||||
private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year)
|
||||
{
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
var adminMonthlyOverview =
|
||||
new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
await _companyContext.AddAsync(adminMonthlyOverview);
|
||||
}
|
||||
workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
}
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
// دریافت همه AdminMonthlyOverview برای این کارگاهها/ماه/سال
|
||||
var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year);
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList();
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId));
|
||||
}
|
||||
|
||||
var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
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();
|
||||
|
||||
var employeeContractCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
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();
|
||||
|
||||
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
||||
|
||||
var now = DateTime.Today;
|
||||
//پرسنل ادمین اجرایی
|
||||
var operatorAdminAccounts = _accountContext.AccountLeftWorks
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkGr <= now && x.LeftWorkGr >= now &&
|
||||
x.RoleId == 5).Select(x => new { x.WorkshopId, x.AccountId })
|
||||
.Join(_accountContext.Accounts,
|
||||
x => x.AccountId,
|
||||
account => account.id, (x, account) => new
|
||||
{
|
||||
x.WorkshopId,
|
||||
account.Fullname
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x =>
|
||||
{
|
||||
var employeeCheckoutCount = employeeCheckoutCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var employeeContractCount = employeeContractCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var workshopWithContractingParty =
|
||||
workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId);
|
||||
|
||||
var operatorAccount = operatorAdminAccounts.FirstOrDefault(o => o.WorkshopId == x.WorkshopId);
|
||||
|
||||
var workshop = workshopWithContractingParty?.Workshop;
|
||||
var contractingParty = workshopWithContractingParty?.ContractingParty;
|
||||
var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer;
|
||||
return new AdminMonthlyOverviewListViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Status = x.Status,
|
||||
Id = x.id,
|
||||
WorkshopName = workshop?.WorkshopFullName ?? "",
|
||||
WorkshopArchiveCode = workshop?.ArchiveCode ?? "",
|
||||
WorkshopArchiveCodeInt = workshop?.ArchiveCode.ExtractIntNumbers() ?? 0,
|
||||
Address = workshop?.Address ?? "",
|
||||
City = workshop?.City ?? "",
|
||||
Province = workshop?.State ?? "",
|
||||
EmployerName = employer?.FullName ?? "",
|
||||
EmployerPhoneNumber = employer?.Phone ?? "",
|
||||
AdminFullName = operatorAccount?.Fullname ?? "",
|
||||
CheckoutEmployeeCount = employeeCheckoutCount?.EmployeeCounts ?? 0,
|
||||
ContractEmployeeCount = employeeContractCount?.EmployeeCounts ?? 0,
|
||||
AgentPhoneNumber = "",
|
||||
IsBlock = contractingParty?.IsBlock == "true"
|
||||
};
|
||||
}).OrderBy(x => x.IsBlock).ThenBy(x => x.WorkshopArchiveCodeInt).ToList();
|
||||
|
||||
|
||||
return adminMonthlyOverviewList;
|
||||
}
|
||||
|
||||
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
|
||||
{
|
||||
var searchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
AdminAccountId = accountId,
|
||||
Month = month,
|
||||
Year = year
|
||||
};
|
||||
var list = await GetWorkshopStatus(searchModel);
|
||||
|
||||
var allCount = list.Count;
|
||||
var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived);
|
||||
var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted);
|
||||
var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress);
|
||||
var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
return new AdminMonthlyOverViewCounterVm
|
||||
{
|
||||
All = allCount,
|
||||
Archived = archivedCount,
|
||||
VisitPending = visitPendingCount,
|
||||
VisitInProgress = visitInProgressCount,
|
||||
VisitCompleted = visitCompleteCount,
|
||||
CreateDocument = createDocCount
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
.Select(x => x.EmployeeId)
|
||||
.Except([5976]).ToList();
|
||||
|
||||
var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Join(
|
||||
_companyContext.Contracts.AsNoTracking(),
|
||||
leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
|
||||
contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
|
||||
(leftWork, contract) => new { leftWork, contract }
|
||||
)
|
||||
.Where(x =>
|
||||
workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||
x.leftWork.StartWorkDate <= targetEndDate &&
|
||||
x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||
x.contract.ContarctStart <= targetEndDate &&
|
||||
x.contract.ContractEnd >= targetStartDate &&
|
||||
!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 });
|
||||
|
||||
var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextStartMonth &&
|
||||
!vipGroup.Contains(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()
|
||||
.Where(x => x.ContarctStart <= nextEndMonth && x.ContractEnd >= nextStartMonth && workshopIds.Contains(x.WorkshopIds))
|
||||
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
||||
.Where(x => x.ContractStart <= targetEndDate && x.ContractEnd >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopId, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var workingCheckoutGrouping = workingCheckoutEmployeeIds.GroupBy(x => x.WorkshopId).ToList();
|
||||
|
||||
var workingContractGrouping = workingContractEmployeeIds.GroupBy(x => x.WorkshopId).Select(x => new
|
||||
{
|
||||
WorkshopId = x.Key,
|
||||
Data = x.ToList()
|
||||
}).ToList();
|
||||
|
||||
var workshopsWithFullContracts = workingContractGrouping
|
||||
.Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.WorkshopId)
|
||||
.ToList();
|
||||
|
||||
var list = workingContractEmployeeIds.ToList().Where(x=>!contractSet.Any(a=>a.EmployeeId== x.EmployeeId&&a.WorkshopIds == x.WorkshopId)).ToList();
|
||||
|
||||
var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
|
||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||
|
||||
//var notFullyCoveredWorkshops = groupedCheckout
|
||||
// .Where(g => g.Any(emp =>
|
||||
// !contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) ||
|
||||
// !checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
// .Select(g => g.Key)
|
||||
// .ToList();
|
||||
|
||||
var notFullyCoveredWorkshops = workshopIds.Except(fullyCoveredWorkshops);
|
||||
|
||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => x.Month == month && x.Year == year);
|
||||
|
||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year)
|
||||
{
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
var adminMonthlyOverview =
|
||||
new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
await _companyContext.AddAsync(adminMonthlyOverview);
|
||||
}
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.HolidayItem;
|
||||
using CompanyManagment.App.Contracts.InsuranceList;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
@@ -21,6 +25,7 @@ using CompanyManagment.App.Contracts.SalaryAid;
|
||||
using CompanyManagment.App.Contracts.WorkingHours;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
@@ -41,8 +46,9 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
|
||||
public CheckoutRepository(IAuthHelper authHelper, CompanyContext context, IConfiguration configuration, ILeftWorkRepository leftWorkRepository, IWorkingHoursTempApplication workingHoursTempApplication, IRollCallRepository rollCallRepository, IRollCallMandatoryRepository rollCallMandatoryRepository) : base(context)
|
||||
public CheckoutRepository(IAuthHelper authHelper, CompanyContext context, IConfiguration configuration, ILeftWorkRepository leftWorkRepository, IWorkingHoursTempApplication workingHoursTempApplication, IRollCallRepository rollCallRepository, IRollCallMandatoryRepository rollCallMandatoryRepository, IRollCallEmployeeRepository rollCallEmployeeRepository) : base(context)
|
||||
{
|
||||
|
||||
_authHelper = authHelper;
|
||||
@@ -52,6 +58,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
_workingHoursTempApplication = workingHoursTempApplication;
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_rollCallMandatoryRepository = rollCallMandatoryRepository;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -123,6 +130,361 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
.FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لود لیست اولیه جهت ایجاد فیش حقوقی
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="month"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year, string month, string contractStart,
|
||||
string contractEnd)
|
||||
{
|
||||
DateTime startSreach;
|
||||
DateTime endSearch;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(contractStart) && !string.IsNullOrWhiteSpace(contractEnd))
|
||||
{
|
||||
startSreach = contractStart.ToGeorgianDateTime();
|
||||
endSearch = contractEnd.ToGeorgianDateTime();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (month == "0" && year == "0")
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
string startStr = $"{now.ToFarsi().Substring(0, 8)}01";
|
||||
startSreach = startStr.ToGeorgianDateTime();
|
||||
endSearch = (startStr.FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
}
|
||||
else if (month == "0" && year != "0")
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
string startStr = $"{year}/{now.ToFarsi().Substring(5, 2)}/01";
|
||||
startSreach = startStr.ToGeorgianDateTime();
|
||||
endSearch = (startStr.FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
}
|
||||
else if (month != "0" && year == "0")
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
string startStr = $"{now.ToFarsi().Substring(0, 4)}/{month}/01";
|
||||
startSreach = startStr.ToGeorgianDateTime();
|
||||
endSearch = (startStr.FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
}
|
||||
else
|
||||
{
|
||||
string startStr = $"{year}/{month}/01";
|
||||
startSreach = startStr.ToGeorgianDateTime();
|
||||
endSearch = (startStr.FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
}
|
||||
|
||||
}
|
||||
var timer = new Stopwatch();
|
||||
timer.Start();
|
||||
|
||||
var contracts = _context.Contracts.AsSplitQuery()
|
||||
.Where(x => x.WorkshopIds == workshopId && x.IsActiveString == "true" && startSreach < x.ContractEnd &&
|
||||
endSearch > x.ContarctStart)
|
||||
.Join(_context.Workshops.AsSplitQuery(),
|
||||
contract => contract.WorkshopIds,
|
||||
workshop => workshop.id,
|
||||
(contract, workshop) => new { contract, workshop })
|
||||
.Join(_context.Employees.AsSplitQuery(),
|
||||
contractWorkshop => contractWorkshop.contract.EmployeeId,
|
||||
employee => employee.id,
|
||||
(contractWorkshop, employee) => new { contractWorkshop, employee })
|
||||
.Join(_context.LeftWorkList.AsSplitQuery().Where(l => l.WorkshopId == workshopId && l.StartWorkDate < endSearch && l.LeftWorkDate > startSreach),
|
||||
contractWorkshopEmployee => contractWorkshopEmployee.contractWorkshop.contract.EmployeeId,
|
||||
leftwork => leftwork.EmployeeId,
|
||||
(contractWorkshopEmployee, leftwork) => new { contractWorkshopEmployee, leftwork })
|
||||
.Join(_context.PersonnelCodeSet.AsSplitQuery().Where(p => p.WorkshopId == workshopId),
|
||||
contractWorkshopEmployeeleftWork => contractWorkshopEmployeeleftWork.contractWorkshopEmployee
|
||||
.contractWorkshop.contract.EmployeeId,
|
||||
personnelCode => personnelCode.EmployeeId,
|
||||
(contractWorkshopEmployeeleftWork, personnelCode) =>
|
||||
new { contractWorkshopEmployeeleftWork, personnelCode })
|
||||
|
||||
.GroupJoin(_context.CheckoutSet.AsSplitQuery(),
|
||||
contractWorkshopEmployeeleftWorkPersonnelCode => contractWorkshopEmployeeleftWorkPersonnelCode
|
||||
.contractWorkshopEmployeeleftWork.contractWorkshopEmployee.contractWorkshop.contract.id,
|
||||
checkout => checkout.ContractId,
|
||||
(contractWorkshopEmployeeleftWorkPersonnelCode, checkout) =>
|
||||
new { contractWorkshopEmployeeleftWorkPersonnelCode, checkout })
|
||||
.ToList();
|
||||
Console.WriteLine("query : " + timer.Elapsed);
|
||||
timer.Reset();
|
||||
timer.Start();
|
||||
if (employeeId > 0)
|
||||
contracts = contracts.Where(x =>
|
||||
x.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.contractWorkshop.contract.EmployeeId == employeeId).ToList();
|
||||
var finalResult = contracts.Select(result =>
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
DateTime currentStart = ($"{DateTime.Now.ToFarsi().Substring(0, 8)}01").ToGeorgianDateTime();
|
||||
DateTime currentEnd = ($"{DateTime.Now.ToFarsi().FindeEndOfMonth()}").ToGeorgianDateTime();
|
||||
var chekoutCreated = result.checkout.FirstOrDefault(x => x.ContractStart < endSearch && x.ContractEnd > startSreach && x.IsActiveString == "true");
|
||||
|
||||
if (chekoutCreated != null)
|
||||
{
|
||||
|
||||
return new CreateCheckoutListViewModel
|
||||
{
|
||||
Id = chekoutCreated.ContractId,
|
||||
|
||||
EmployeeId = chekoutCreated.EmployeeId,
|
||||
ContractNo = chekoutCreated.ContractNo,
|
||||
WorkshopName = chekoutCreated.WorkshopName,
|
||||
EmployeeName = chekoutCreated.EmployeeFullName,
|
||||
ContractStart = chekoutCreated.ContractStart.ToFarsi(),
|
||||
ContractEnd = chekoutCreated.ContractEnd.ToFarsi(),
|
||||
PersonnelCode = Convert.ToInt64(chekoutCreated.PersonnelCode),
|
||||
LaterThanEnd = false,
|
||||
Extension = false,
|
||||
Description = "دارای فیش حقوقی",
|
||||
HasCheckout = true
|
||||
};
|
||||
}
|
||||
var employeeJoin = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.employee.id;
|
||||
|
||||
bool hasRollCall =
|
||||
_rollCallEmployeeRepository.HasRollCallRecord(employeeJoin, workshopId, startSreach, endSearch);
|
||||
|
||||
var leftWork = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.leftwork;
|
||||
|
||||
bool extension = true;
|
||||
bool laterThanEnd = false;
|
||||
string description = "";
|
||||
string leftWorkDate="";
|
||||
string contractStart = "";
|
||||
string contractEnd = "";
|
||||
|
||||
var contractStartGr = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.contractWorkshop.contract.ContarctStart;
|
||||
var contractEndGr = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.contractWorkshop.contract.ContractEnd;
|
||||
#region HasRollCall
|
||||
|
||||
if (hasRollCall)
|
||||
{
|
||||
|
||||
// اگر ترک کار کرده بود
|
||||
// اگر ترک کارش در بازه انتخاب شده بود
|
||||
if (leftWork.HasLeft && leftWork.LeftWorkDate > startSreach && leftWork.LeftWorkDate <= endSearch)
|
||||
{
|
||||
//اگر بازه انتخاب شده در تاریخ جاری بود
|
||||
if (startSreach == currentStart && endSearch == currentEnd)
|
||||
{
|
||||
//اگر ترک کارش قبل یا مساوی تاریخ جاری بود
|
||||
if (leftWork.LeftWorkDate <= now)
|
||||
{
|
||||
//مجاز به ایجاد تصفیه
|
||||
extension = true;
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = leftWork.LeftWorkDate.AddDays(-1).ToFarsi();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// مجاز نیست
|
||||
extension = false;
|
||||
description = "بعد از تاریخ ترک کار می توانید فیش صادر کنید";
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = leftWork.LeftWorkDate.AddDays(-1).ToFarsi();
|
||||
|
||||
}
|
||||
}
|
||||
else if (endSearch < currentStart)
|
||||
{
|
||||
extension = true;
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = leftWork.LeftWorkDate.AddDays(-1).ToFarsi();
|
||||
}
|
||||
else if (startSreach > currentEnd)
|
||||
{
|
||||
// مجاز نیست
|
||||
extension = false;
|
||||
description = "بعد از تاریخ ترک کار می توانید فیش صادر کنید";
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = leftWork.LeftWorkDate.AddDays(-1).ToFarsi();
|
||||
}
|
||||
|
||||
}
|
||||
else if (leftWork.HasLeft && leftWork.LeftWorkDate <= startSreach)
|
||||
{
|
||||
// مجاز نیست
|
||||
extension = false;
|
||||
description = "به دلیل ترک کار پیش از تاریخ انتخاب شده مجاز به ایجاد فیش نمی باشید";
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
|
||||
}
|
||||
else if (!leftWork.HasLeft && startSreach == currentStart)
|
||||
{
|
||||
// مجاز نیست
|
||||
extension = false;
|
||||
description = "به دلیل داشتن حضورغیاب تا پایان ماه مجاز به ایجاد فیش نمی باشید";
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = endSearch.ToFarsi();
|
||||
|
||||
}
|
||||
else if (!leftWork.HasLeft && startSreach < currentStart)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if (contractStartGr <= startSreach && contractStartGr > endSearch)
|
||||
{
|
||||
laterThanEnd = true;
|
||||
extension = true;
|
||||
contractStart = startSreach.ToFarsi();
|
||||
contractEnd = endSearch.ToFarsi();
|
||||
}
|
||||
else
|
||||
{
|
||||
laterThanEnd = false;
|
||||
extension = true;
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = (leftWork.LeftWorkDate > startSreach && leftWork.LeftWorkDate <= endSearch) ? leftWork.LeftWorkDate.AddDays(-1).ToFarsi() : endSearch.ToFarsi();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static
|
||||
|
||||
if (!hasRollCall)
|
||||
{
|
||||
if (leftWork.HasLeft)
|
||||
{
|
||||
if (leftWork.LeftWorkDate > startSreach && leftWork.LeftWorkDate <= endSearch)
|
||||
{
|
||||
extension = true;
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = leftWork.LeftWorkDate.AddDays(-1).ToFarsi();
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
}
|
||||
else if (leftWork.LeftWorkDate <= startSreach)
|
||||
{
|
||||
// مجاز نیست
|
||||
extension = false;
|
||||
description = "به دلیل ترک کار پیش از تاریخ انتخاب شده مجاز به ایجاد فیش نمی باشید";
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
}
|
||||
else if(leftWork.LeftWorkDate > endSearch)
|
||||
{
|
||||
extension = true;
|
||||
|
||||
if (contractStartGr <= startSreach && contractStartGr > endSearch)
|
||||
{
|
||||
laterThanEnd = true;
|
||||
|
||||
contractStart = startSreach.ToFarsi();
|
||||
contractEnd = endSearch.ToFarsi();
|
||||
}
|
||||
else
|
||||
{
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = endSearch.ToFarsi();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
extension = true;
|
||||
|
||||
if (contractStartGr <= startSreach && contractStartGr > endSearch)
|
||||
{
|
||||
laterThanEnd = true;
|
||||
|
||||
contractStart = startSreach.ToFarsi();
|
||||
contractEnd = endSearch.ToFarsi();
|
||||
}
|
||||
else
|
||||
{
|
||||
contractStart = leftWork.StartWorkDate > startSreach
|
||||
? leftWork.StartWorkDate.ToFarsi()
|
||||
: startSreach.ToFarsi();
|
||||
contractEnd = endSearch.ToFarsi();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
return new CreateCheckoutListViewModel
|
||||
{
|
||||
Id = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.contractWorkshop.contract.id,
|
||||
|
||||
EmployeeId = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.employee.id,
|
||||
ContractNo = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.contractWorkshop.contract.ContractNo,
|
||||
//EmployerName = result.contract.EmployerName,
|
||||
WorkshopName = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.contractWorkshop.workshop.WorkshopFullName,
|
||||
EmployeeName = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
.contractWorkshopEmployee.employee.FullName,
|
||||
|
||||
PersonnelCode = result.contractWorkshopEmployeeleftWorkPersonnelCode.personnelCode.PersonnelCode,
|
||||
//PersonnelCodeInt = Convert.ToInt32(result.contract.PersonnelCode),
|
||||
LaterThanEnd = laterThanEnd,
|
||||
Extension = extension,
|
||||
Description = description,
|
||||
ContractStart = contractStart,
|
||||
ContractEnd = contractEnd,
|
||||
LeftWorkDate = leftWorkDate
|
||||
};
|
||||
|
||||
}).OrderByDescending(x=>x.Extension).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
Console.WriteLine("process : " + timer.Elapsed);
|
||||
|
||||
return new CreateCheckoutListViewModel()
|
||||
{
|
||||
CreateCheckoutList = finalResult
|
||||
};
|
||||
}
|
||||
|
||||
public async Task CreateCkeckout(Checkout command)
|
||||
{
|
||||
|
||||
@@ -1146,14 +1508,20 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
var firstRollCall = orderedRollcalls.FirstOrDefault();
|
||||
var secondRollCall = orderedRollcalls.Skip(1).FirstOrDefault();
|
||||
DateTime? secondRCEndDate = null;
|
||||
DateTime? firstRCEndDate = null;
|
||||
|
||||
if (firstRollCall != null)
|
||||
firstRCEndDate = firstRollCall.ShiftEndWithoutRest ?? firstRollCall.EndDate;
|
||||
if (secondRollCall != null)
|
||||
secondRCEndDate = secondRollCall.ShiftEndWithoutRest ?? secondRollCall.EndDate;
|
||||
|
||||
|
||||
var firstRCEndDate = firstRollCall.ShiftEndWithoutRest ?? firstRollCall.EndDate;
|
||||
var secondRCEndDate = secondRollCall.ShiftEndWithoutRest ?? secondRollCall.EndDate;
|
||||
|
||||
return new CheckoutDailyRollCallViewModel()
|
||||
{
|
||||
StartDate1 = firstRollCall?.StartDate?.ToString("HH:mm") ?? "",
|
||||
EndDate1 =firstRCEndDate?.ToString("HH:mm") ?? "",
|
||||
EndDate1 = firstRCEndDate?.ToString("HH:mm") ?? "",
|
||||
|
||||
StartDate2 = secondRollCall?.StartDate?.ToString("HH:mm") ?? "",
|
||||
EndDate2 = secondRCEndDate?.ToString("HH:mm") ?? "",
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class ContactUsRepository:RepositoryBase<long,ContactUs>,IContactUsRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
public ContactUsRepository(CompanyContext companyContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
}
|
||||
@@ -8,351 +8,364 @@ using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewM
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext, IAuthHelper authHelper, IEmployeeRepository employeeRepository)
|
||||
: RepositoryBase<long, CustomizeWorkshopSettings>(companyContext), ICustomizeWorkshopSettingsRepository
|
||||
{
|
||||
public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext, IAuthHelper authHelper, IEmployeeRepository employeeRepository)
|
||||
: RepositoryBase<long, CustomizeWorkshopSettings>(companyContext), ICustomizeWorkshopSettingsRepository
|
||||
private readonly CompanyContext _companyContext = companyContext;
|
||||
private readonly IAuthHelper _authHelper = authHelper;
|
||||
private readonly IEmployeeRepository _employeeRepository = employeeRepository;
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth)
|
||||
{
|
||||
private readonly CompanyContext _companyContext = companyContext;
|
||||
private readonly IAuthHelper _authHelper = authHelper;
|
||||
private readonly IEmployeeRepository _employeeRepository = employeeRepository;
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery()
|
||||
.FirstOrDefault();
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth)
|
||||
var employeeIds = entity.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Select(y => y.EmployeeId)
|
||||
.ToList();
|
||||
var employees = _employeeRepository.GetBy(employeeIds);
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery()
|
||||
.FirstOrDefault();
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
var employeeIds = entity.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Select(y => y.EmployeeId)
|
||||
.ToList();
|
||||
var employees = _employeeRepository.GetBy(employeeIds);
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
Name = auth.WorkshopList.FirstOrDefault(w => w.Id == entity.WorkshopId)?.Name,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
GroupName = x.GroupName,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
IrregularShift = x.IrregularShift,
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.
|
||||
Select(r=>new CustomizeRotatingShiftsViewModel(){StartTime = r.StartTime.ToString("HH:mm"), EndTime = r.EndTime.ToString("HH:mm")}).ToList()
|
||||
}).ToList(),
|
||||
|
||||
};
|
||||
}
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery()
|
||||
.FirstOrDefault();
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
Offset = entity.EndTimeOffSet,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
GroupName = x.GroupName,
|
||||
RollCallWorkshopEmployeesSettings = x.CustomizeWorkshopEmployeeSettingsCollection.Select(y =>
|
||||
{
|
||||
var employee = _employeeRepository.Get(y.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = y.id,
|
||||
EmployeeId = y.EmployeeId,
|
||||
IsSettingChanged = y.IsSettingChanged,
|
||||
IsShiftChanged = y.IsShiftChanged,
|
||||
Name = $"{employee?.FName} {employee?.LName}",
|
||||
RollCallWorkshopShifts = y.CustomizeWorkshopEmployeeSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
Salary = y.Salary,
|
||||
CustomizeRotatingShiftsViewModels = y.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
LeavePermittedDays = y.LeavePermittedDays,
|
||||
IrregularShift = y.IrregularShift,
|
||||
WorkshopShiftStatus = y.WorkshopShiftStatus
|
||||
};
|
||||
}).ToList(),
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.Select(r=>new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
IrregularShift = x.IrregularShift
|
||||
|
||||
|
||||
|
||||
}).ToList(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public EditCustomizeWorkshopSettings GetWorkshopSettingsDetails(long workshopId)
|
||||
{
|
||||
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
if (entity == null)
|
||||
return new();
|
||||
var viewModel = new EditCustomizeWorkshopSettings()
|
||||
{
|
||||
FridayWork = entity.FridayWork,
|
||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
LateToWork = new()
|
||||
{
|
||||
LateToWorkTimeFinesVewModels = entity.LateToWork.LateToWorkTimeFines.Select(x =>
|
||||
new LateToWorkTimeFineVewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.LateToWork.Value,
|
||||
LateToWorkType = entity.LateToWork.LateToWorkType
|
||||
},
|
||||
HolidayWork = entity.HolidayWork,
|
||||
FineAbsenceDeduction = new()
|
||||
{
|
||||
Value = entity.FineAbsenceDeduction.Value,
|
||||
FineAbsenceDayOfWeekViewModels = entity.FineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeekViewModel() { DayOfWeek = x.DayOfWeek }).ToList(),
|
||||
FineAbsenceDeductionType = entity.FineAbsenceDeduction.FineAbsenceDeductionType
|
||||
},
|
||||
EarlyExit = new()
|
||||
{
|
||||
EarlyExitTimeFinesViewModels = entity.EarlyExit.EarlyExitTimeFines.Select(x =>
|
||||
new EarlyExitTimeFineViewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.EarlyExit.Value,
|
||||
EarlyExitType = entity.EarlyExit.EarlyExitType
|
||||
},
|
||||
BonusesPay = new()
|
||||
{
|
||||
Value = entity.BonusesPay.Value,
|
||||
BonusesPayType = entity.BonusesPay.BonusesPayType,
|
||||
PaymentType = entity.BonusesPay.PaymentType
|
||||
},
|
||||
ShiftPay = new()
|
||||
{
|
||||
Value = entity.ShiftPay.Value,
|
||||
ShiftPayType = entity.ShiftPay.ShiftPayType,
|
||||
ShiftType = entity.ShiftPay.ShiftType
|
||||
},
|
||||
InsuranceDeduction = new()
|
||||
{
|
||||
Value = entity.InsuranceDeduction.Value,
|
||||
InsuranceDeductionType = entity.InsuranceDeduction.InsuranceDeductionType
|
||||
},
|
||||
OverTimePay = new()
|
||||
{ OverTimePayType = entity.OverTimePay.OverTimePayType, Value = entity.OverTimePay.Value },
|
||||
BaseYearsPay = new()
|
||||
{
|
||||
BaseYearsPayType = entity.BaseYearsPay.BaseYearsPayType,
|
||||
Value = entity.BaseYearsPay.Value,
|
||||
PaymentType = entity.BaseYearsPay.PaymentType
|
||||
},
|
||||
NightWorkPay = new()
|
||||
{ NightWorkingType = entity.NightWorkPay.NightWorkingType, Value = entity.NightWorkPay.Value },
|
||||
LeavePay = new()
|
||||
{
|
||||
Value = entity.LeavePay.Value,
|
||||
LeavePayType = entity.LeavePay.LeavePayType
|
||||
},
|
||||
MarriedAllowance = new()
|
||||
{
|
||||
Value = entity.MarriedAllowance.Value,
|
||||
MarriedAllowanceType = entity.MarriedAllowance.MarriedAllowanceType
|
||||
},
|
||||
FamilyAllowance = new()
|
||||
{
|
||||
FamilyAllowanceType = entity.FamilyAllowance.FamilyAllowanceType,
|
||||
Value = entity.FamilyAllowance.Value
|
||||
},
|
||||
Currency = entity.Currency,
|
||||
MaxMonthDays = entity.MaxMonthDays,
|
||||
Id = entity.id,
|
||||
ShiftsList = entity.CustomizeWorkshopSettingsShifts.Select(x => new CustomizeWorkshopShiftViewModel()
|
||||
{ EndTime = x.EndTime.ToString("HH:mm"), Placement = x.Placement, StartTime = x.StartTime.ToString("HH:mm") }).ToList(),
|
||||
BonusesPaysInEndOfMonth = entity.BonusesPaysInEndOfMonth,
|
||||
LeavePermittedDays = entity.LeavePermittedDays,
|
||||
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus
|
||||
|
||||
};
|
||||
return viewModel;
|
||||
|
||||
}
|
||||
|
||||
public CustomizeWorkshopSettings GetBy(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopSettings.FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
public EditCustomizeWorkshopSettings GetSimpleWorkshopSettings(long workshopId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
if (entity == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
return new()
|
||||
{
|
||||
ShiftsList = entity.CustomizeWorkshopSettingsShifts.Select(x => new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
StartTime = x.StartTime.ToString("HH:mm"),
|
||||
Placement = x.Placement
|
||||
}).ToList(),
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||
FridayWork = entity.FridayWork,
|
||||
HolidayWork = entity.HolidayWork
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public List<ChangedGroupedViewModel> GetShiftChangesGroupAndEmployees(long customizeWorkshopSettingsId)
|
||||
{
|
||||
|
||||
|
||||
var result = from groupSetting in _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery()
|
||||
where groupSetting.IsShiftChange // Filter parent tables where isChange is true
|
||||
join employeeSettings in _companyContext.CustomizeWorkshopEmployeeSettings on groupSetting.id equals employeeSettings.CustomizeWorkshopGroupSettingId
|
||||
where employeeSettings.IsShiftChanged// Filter child tables where isChange is true
|
||||
join employee in _companyContext.Employees on employeeSettings.EmployeeId equals employee.id
|
||||
group new { employee.FullName, groupSetting.GroupName } by groupSetting.id into grouped
|
||||
select new ChangedGroupedViewModel
|
||||
{
|
||||
GroupName = grouped.First().GroupName,
|
||||
EmployeeName = grouped.Select(e => e.FullName).ToList()
|
||||
};
|
||||
|
||||
return result.ToList();
|
||||
|
||||
}
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopIncludeGroupsByWorkshopId(long workshopId)
|
||||
{
|
||||
var customizeWorkshopSettings = _companyContext.CustomizeWorkshopSettings
|
||||
.AsNoTracking().AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.Select(x => new CustomizeWorkshopSettingsViewModel()
|
||||
Id = entity.id,
|
||||
Name = auth.WorkshopList.FirstOrDefault(w => w.Id == entity.WorkshopId)?.Name,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
GroupSettings = x.CustomizeWorkshopGroupSettingsCollection.Select(g =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
GroupName = x.GroupName,
|
||||
RollCallWorkshopEmployeesSettings = x.CustomizeWorkshopEmployeeSettingsCollection.Select(y =>
|
||||
{
|
||||
var employee = employees.First(e => e.Id == y.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = g.id,
|
||||
IrregularShift = g.IrregularShift,
|
||||
WorkshopShiftStatus = g.WorkshopShiftStatus,
|
||||
GroupName = g.GroupName,
|
||||
MainGroup = g.MainGroup,
|
||||
Salary = g.Salary,
|
||||
SalaryStr = g.Salary.ToMoney(),
|
||||
LeavePermitted = g.LeavePermittedDays,
|
||||
RollCallWorkshopShifts = g.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
Id = y.id,
|
||||
EmployeeId = y.EmployeeId,
|
||||
IsSettingChanged = y.IsSettingChanged,
|
||||
IsShiftChanged = y.IsShiftChanged,
|
||||
Name = $"{employee}",
|
||||
RollCallWorkshopShifts = y.CustomizeWorkshopEmployeeSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
StartTime = s.StartTime.ToString("HH:mm"),
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
BreakTime = g.BreakTime,
|
||||
HolidayWork = g.HolidayWork,
|
||||
FridayWork = g.FridayWork,
|
||||
CustomizeRotatingShiftsViewModels = g.CustomizeRotatingShifts.Select(r=>new CustomizeRotatingShiftsViewModel()
|
||||
{
|
||||
EndTime = r.EndTime.ToString("HH:mm"),
|
||||
StartTime= r.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
|
||||
}).ToList(),
|
||||
Salary = y.Salary,
|
||||
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
return customizeWorkshopSettings;
|
||||
}
|
||||
|
||||
public CustomizeWorkshopEmployeeSettingsViewModel GetEmployeeSettingsByWorkshopIdEmployeeId(long workshopId, long employeeId)
|
||||
{
|
||||
var employee = _companyContext.CustomizeWorkshopSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId)?.CustomizeWorkshopGroupSettingsCollection.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
|
||||
if (employee == null)
|
||||
return new();
|
||||
|
||||
var employeeName = _companyContext.Employees.Select(x => new { x.FullName, x.id })
|
||||
.FirstOrDefault(x => x.id == employee.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = employee.id,
|
||||
EmployeeId = employee.EmployeeId,
|
||||
IsSettingChanged = employee.IsSettingChanged,
|
||||
IsShiftChanged = employee.IsShiftChanged,
|
||||
Name = employeeName?.FullName,
|
||||
RollCallWorkshopShifts = employee.CustomizeWorkshopEmployeeSettingsShifts.Select(x =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
Placement = x.Placement,
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
};
|
||||
}).ToList(),
|
||||
Salary = employee.Salary
|
||||
};
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
IrregularShift = x.IrregularShift,
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.
|
||||
Select(r=>new CustomizeRotatingShiftsViewModel(){StartTime = r.StartTime.ToString("HH:mm"), EndTime = r.EndTime.ToString("HH:mm")}).ToList()
|
||||
}).ToList(),
|
||||
|
||||
};
|
||||
}
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery()
|
||||
.FirstOrDefault();
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
Offset = entity.EndTimeOffSet,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
GroupName = x.GroupName,
|
||||
RollCallWorkshopEmployeesSettings = x.CustomizeWorkshopEmployeeSettingsCollection.Select(y =>
|
||||
{
|
||||
var employee = _employeeRepository.Get(y.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = y.id,
|
||||
EmployeeId = y.EmployeeId,
|
||||
IsSettingChanged = y.IsSettingChanged,
|
||||
IsShiftChanged = y.IsShiftChanged,
|
||||
Name = $"{employee?.FName} {employee?.LName}",
|
||||
RollCallWorkshopShifts = y.CustomizeWorkshopEmployeeSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
Salary = y.Salary,
|
||||
CustomizeRotatingShiftsViewModels = y.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
LeavePermittedDays = y.LeavePermittedDays,
|
||||
IrregularShift = y.IrregularShift,
|
||||
WorkshopShiftStatus = y.WorkshopShiftStatus
|
||||
};
|
||||
}).ToList(),
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
IrregularShift = x.IrregularShift
|
||||
|
||||
|
||||
|
||||
}).ToList(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public EditCustomizeWorkshopSettings GetWorkshopSettingsDetails(long workshopId)
|
||||
{
|
||||
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
if (entity == null)
|
||||
return new();
|
||||
var viewModel = new EditCustomizeWorkshopSettings()
|
||||
{
|
||||
FridayWork = entity.FridayWork,
|
||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
LateToWork = new()
|
||||
{
|
||||
LateToWorkTimeFinesVewModels = entity.LateToWork.LateToWorkTimeFines.Select(x =>
|
||||
new LateToWorkTimeFineVewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.LateToWork.Value,
|
||||
LateToWorkType = entity.LateToWork.LateToWorkType
|
||||
},
|
||||
HolidayWork = entity.HolidayWork,
|
||||
FineAbsenceDeduction = new()
|
||||
{
|
||||
Value = entity.FineAbsenceDeduction.Value,
|
||||
FineAbsenceDayOfWeekViewModels = entity.FineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeekViewModel() { DayOfWeek = x.DayOfWeek }).ToList(),
|
||||
FineAbsenceDeductionType = entity.FineAbsenceDeduction.FineAbsenceDeductionType
|
||||
},
|
||||
EarlyExit = new()
|
||||
{
|
||||
EarlyExitTimeFinesViewModels = entity.EarlyExit.EarlyExitTimeFines.Select(x =>
|
||||
new EarlyExitTimeFineViewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.EarlyExit.Value,
|
||||
EarlyExitType = entity.EarlyExit.EarlyExitType
|
||||
},
|
||||
BonusesPay = new()
|
||||
{
|
||||
Value = entity.BonusesPay.Value,
|
||||
BonusesPayType = entity.BonusesPay.BonusesPayType,
|
||||
PaymentType = entity.BonusesPay.PaymentType
|
||||
},
|
||||
ShiftPay = new()
|
||||
{
|
||||
Value = entity.ShiftPay.Value,
|
||||
ShiftPayType = entity.ShiftPay.ShiftPayType,
|
||||
ShiftType = entity.ShiftPay.ShiftType
|
||||
},
|
||||
InsuranceDeduction = new()
|
||||
{
|
||||
Value = entity.InsuranceDeduction.Value,
|
||||
InsuranceDeductionType = entity.InsuranceDeduction.InsuranceDeductionType
|
||||
},
|
||||
OverTimePay = new()
|
||||
{ OverTimePayType = entity.OverTimePay.OverTimePayType, Value = entity.OverTimePay.Value },
|
||||
BaseYearsPay = new()
|
||||
{
|
||||
BaseYearsPayType = entity.BaseYearsPay.BaseYearsPayType,
|
||||
Value = entity.BaseYearsPay.Value,
|
||||
PaymentType = entity.BaseYearsPay.PaymentType
|
||||
},
|
||||
NightWorkPay = new()
|
||||
{ NightWorkingType = entity.NightWorkPay.NightWorkingType, Value = entity.NightWorkPay.Value },
|
||||
LeavePay = new()
|
||||
{
|
||||
Value = entity.LeavePay.Value,
|
||||
LeavePayType = entity.LeavePay.LeavePayType
|
||||
},
|
||||
MarriedAllowance = new()
|
||||
{
|
||||
Value = entity.MarriedAllowance.Value,
|
||||
MarriedAllowanceType = entity.MarriedAllowance.MarriedAllowanceType
|
||||
},
|
||||
FamilyAllowance = new()
|
||||
{
|
||||
FamilyAllowanceType = entity.FamilyAllowance.FamilyAllowanceType,
|
||||
Value = entity.FamilyAllowance.Value
|
||||
},
|
||||
Currency = entity.Currency,
|
||||
MaxMonthDays = entity.MaxMonthDays,
|
||||
Id = entity.id,
|
||||
ShiftsList = entity.CustomizeWorkshopSettingsShifts.Select(x => new CustomizeWorkshopShiftViewModel()
|
||||
{ EndTime = x.EndTime.ToString("HH:mm"), Placement = x.Placement, StartTime = x.StartTime.ToString("HH:mm") }).ToList(),
|
||||
BonusesPaysInEndOfMonth = entity.BonusesPaysInEndOfMonth,
|
||||
LeavePermittedDays = entity.LeavePermittedDays,
|
||||
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus
|
||||
|
||||
};
|
||||
return viewModel;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public EditCustomizeWorkshopSettings GetSimpleWorkshopSettings(long workshopId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
if (entity == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsWithMonthlySalary(long workshopId)
|
||||
return new()
|
||||
{
|
||||
var query = _companyContext.CustomizeWorkshopGroupSettings.Where(x => x.MainGroup == false).Include(x => x)
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection).Where(x => x.CustomizeWorkshopEmployeeSettingsCollection.Any(y =>
|
||||
ShiftsList = entity.CustomizeWorkshopSettingsShifts.Select(x => new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
StartTime = x.StartTime.ToString("HH:mm"),
|
||||
Placement = x.Placement
|
||||
}).ToList(),
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||
FridayWork = entity.FridayWork,
|
||||
HolidayWork = entity.HolidayWork
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public List<ChangedGroupedViewModel> GetShiftChangesGroupAndEmployees(long customizeWorkshopSettingsId)
|
||||
{
|
||||
|
||||
|
||||
var result = from groupSetting in _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery()
|
||||
where groupSetting.IsShiftChange // Filter parent tables where isChange is true
|
||||
join employeeSettings in _companyContext.CustomizeWorkshopEmployeeSettings on groupSetting.id equals employeeSettings.CustomizeWorkshopGroupSettingId
|
||||
where employeeSettings.IsShiftChanged// Filter child tables where isChange is true
|
||||
join employee in _companyContext.Employees on employeeSettings.EmployeeId equals employee.id
|
||||
group new { employee.FullName, groupSetting.GroupName } by groupSetting.id into grouped
|
||||
select new ChangedGroupedViewModel
|
||||
{
|
||||
GroupName = grouped.First().GroupName,
|
||||
EmployeeName = grouped.Select(e => e.FullName).ToList()
|
||||
};
|
||||
|
||||
return result.ToList();
|
||||
|
||||
}
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopIncludeGroupsByWorkshopId(long workshopId)
|
||||
{
|
||||
var customizeWorkshopSettings = _companyContext.CustomizeWorkshopSettings
|
||||
.AsNoTracking().AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.Select(x => new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
GroupSettings = x.CustomizeWorkshopGroupSettingsCollection.Select(g =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = g.id,
|
||||
IrregularShift = g.IrregularShift,
|
||||
WorkshopShiftStatus = g.WorkshopShiftStatus,
|
||||
GroupName = g.GroupName,
|
||||
MainGroup = g.MainGroup,
|
||||
RollCallWorkshopShifts = g.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
StartTime = s.StartTime.ToString("HH:mm"),
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
}).ToList(),
|
||||
BreakTime = g.BreakTime,
|
||||
HolidayWork = g.HolidayWork,
|
||||
FridayWork = g.FridayWork,
|
||||
CustomizeRotatingShiftsViewModels = g.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel()
|
||||
{
|
||||
EndTime = r.EndTime.ToString("HH:mm"),
|
||||
StartTime = r.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
|
||||
}).ToList(),
|
||||
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
return customizeWorkshopSettings;
|
||||
}
|
||||
|
||||
public CustomizeWorkshopEmployeeSettingsViewModel GetEmployeeSettingsByWorkshopIdEmployeeId(long workshopId, long employeeId)
|
||||
{
|
||||
var employee = _companyContext.CustomizeWorkshopSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId)?.CustomizeWorkshopGroupSettingsCollection.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
|
||||
if (employee == null)
|
||||
return new();
|
||||
|
||||
var employeeName = _companyContext.Employees.Select(x => new { x.FullName, x.id })
|
||||
.FirstOrDefault(x => x.id == employee.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = employee.id,
|
||||
EmployeeId = employee.EmployeeId,
|
||||
IsSettingChanged = employee.IsSettingChanged,
|
||||
IsShiftChanged = employee.IsShiftChanged,
|
||||
Name = employeeName?.FullName,
|
||||
RollCallWorkshopShifts = employee.CustomizeWorkshopEmployeeSettingsShifts.Select(x =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
Placement = x.Placement,
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
Salary = employee.Salary
|
||||
};
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsWithMonthlySalary(long workshopId)
|
||||
{
|
||||
var query = _companyContext.CustomizeWorkshopGroupSettings.Where(x => x.MainGroup == false).Include(x => x)
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection).Where(x => x.CustomizeWorkshopEmployeeSettingsCollection.Any(y =>
|
||||
y.WorkshopId == workshopId)).SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Where(x => x.Salary > 0).Select(x =>
|
||||
.Where(x => x.Salary > 0).Select(x =>
|
||||
new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
@@ -361,26 +374,31 @@ namespace CompanyManagment.EFCore.Repository
|
||||
EmployeeId = x.EmployeeId,
|
||||
BreakTime = x.BreakTime
|
||||
});
|
||||
return query.ToList();
|
||||
}
|
||||
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsByWorkshopId(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopSettings.AsNoTracking().Where(x => x.WorkshopId == workshopId).Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).SelectMany(x => x.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(y => y.CustomizeWorkshopEmployeeSettingsCollection))
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsViewModel
|
||||
{
|
||||
BreakTime = x.BreakTime,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Id = x.id,
|
||||
Salary = x.Salary,
|
||||
GroupSettingsId = x.CustomizeWorkshopGroupSettingId
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
return query.ToList();
|
||||
}
|
||||
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsByWorkshopId(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopSettings.AsNoTracking().Where(x => x.WorkshopId == workshopId).Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).SelectMany(x => x.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(y => y.CustomizeWorkshopEmployeeSettingsCollection))
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsViewModel
|
||||
{
|
||||
BreakTime = x.BreakTime,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Id = x.id,
|
||||
Salary = x.Salary,
|
||||
GroupSettingsId = x.CustomizeWorkshopGroupSettingId
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public CustomizeWorkshopSettings GetBy(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopSettings.AsSplitQuery()
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1173,7 +1173,17 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
//RequiredDocuments = requiredDocs
|
||||
};
|
||||
}).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;
|
||||
|
||||
}
|
||||
@@ -1194,7 +1204,7 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel()
|
||||
{
|
||||
WorkshopId = x.Key,
|
||||
WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopName,
|
||||
WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopFullName,
|
||||
EmployeesWithoutDocumentCount = x.Count()
|
||||
});
|
||||
|
||||
@@ -1301,7 +1311,19 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
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;
|
||||
}
|
||||
|
||||
public async Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(List<long> workshops, long roleId)
|
||||
@@ -1463,9 +1485,19 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
//RequiredDocuments = requiredDocs
|
||||
};
|
||||
}).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;
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId)
|
||||
@@ -1568,8 +1600,18 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
//RequiredDocuments = requiredDocs
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
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;
|
||||
}
|
||||
|
||||
//ToDo آپلود مدارک و افزودن پرسنل
|
||||
@@ -1646,8 +1688,12 @@ 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)
|
||||
{
|
||||
if (items == null || items.Count == 0)
|
||||
|
||||
@@ -397,7 +397,9 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature,
|
||||
ExpireColor = ExpColor(x.ContractEndGr, x.SearchAmount,
|
||||
x.IsActiveString),
|
||||
x.IsActiveString).result,
|
||||
IsExpier = ExpColor(x.ContractEndGr, x.SearchAmount,
|
||||
x.IsActiveString).isExpier,
|
||||
BalanceDouble = TotalBalance(x.ContractingPartyId).TotalBalanceDbl,
|
||||
BalanceStr = TotalBalance(x.ContractingPartyId).TotalBalanceStr,
|
||||
EmployerViewModels = x.EmployerViewModels,
|
||||
@@ -441,6 +443,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature,
|
||||
ExpireColor = x.ExpireColor,
|
||||
IsExpier = x.IsExpier,
|
||||
BalanceDouble = x.BalanceDouble,
|
||||
BalanceStr = x.BalanceStr,
|
||||
EmployerViewModels = x.EmployerViewModels,
|
||||
@@ -458,7 +461,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
}).OrderBy(x => x.WorkshopCount != "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
.ThenBy(x => x.WorkshopCount == "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
.ThenBy(x => x.ExpireColor == "red")
|
||||
.ThenBy(x => x.IsExpier == "true")
|
||||
.ThenBy(x => x.ExpireColor == "purple")
|
||||
.ThenBy(x => x.ExpireColor == "black").ToList();
|
||||
Console.WriteLine("test >>> " + timer.Elapsed);
|
||||
@@ -577,7 +580,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return res;
|
||||
}
|
||||
|
||||
public string ExpColor(DateTime contractEndGr, double contractAmount,
|
||||
public (string result, string isExpier) ExpColor(DateTime contractEndGr, double contractAmount,
|
||||
string isActiveString)
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
@@ -585,16 +588,35 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
var endFa = nowFa.FindeEndOfMonth();
|
||||
var endThisMontGr = endFa.ToGeorgianDateTime();
|
||||
string result = "";
|
||||
|
||||
string isExpier = "false";
|
||||
if (contractEndGr < now)
|
||||
{
|
||||
result = "black";
|
||||
isExpier = "true";
|
||||
}
|
||||
|
||||
if (contractEndGr >= now && contractEndGr <= endThisMontGr)
|
||||
{
|
||||
result = "red";
|
||||
isExpier = "true";
|
||||
}
|
||||
|
||||
if (contractAmount == 0)
|
||||
{
|
||||
result = "purple";
|
||||
if ((contractEndGr >= now && contractEndGr <= endThisMontGr) || (contractEndGr < now))
|
||||
{
|
||||
isExpier = "true";
|
||||
}
|
||||
}
|
||||
|
||||
if (isActiveString == "blue")
|
||||
{
|
||||
result = "blue";
|
||||
return result;
|
||||
isExpier = "false";
|
||||
}
|
||||
|
||||
return (result, isExpier);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -796,5 +796,11 @@ public class LeftWorkInsuranceRepository : RepositoryBase<long, LeftWorkInsuranc
|
||||
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
|
||||
}
|
||||
@@ -652,8 +652,12 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
public List<LeftWorkViewModel> SearchCreateContract(LeftWorkSearchModel searchModel)
|
||||
{
|
||||
var vipGroup = _context.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
||||
.Select(x => x.EmployeeId).ToList();
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
.Select(x => x.EmployeeId)
|
||||
.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()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
@@ -671,7 +675,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
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)
|
||||
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
||||
if (searchModel.EmployeeId != 0 && searchModel.WorkshopId == 0)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
@@ -169,6 +170,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
}
|
||||
|
||||
|
||||
public InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command)
|
||||
{
|
||||
var planPercentage = _context.PlanPercentages.FirstOrDefault();
|
||||
@@ -182,10 +184,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
var dailyWage = dailyWageYearlySalery.YearlySalaryItemsList.Where(x => x.ItemName == "مزد روزانه")
|
||||
.Select(x => x.ItemValue).FirstOrDefault();
|
||||
if (command.ContractAndCheckout)
|
||||
command.ContractAndCheckoutInPerson = true;
|
||||
if(command.Insurance)
|
||||
command.InsuranceInPerson = true;
|
||||
|
||||
|
||||
if (command.CountPerson > 0)
|
||||
{
|
||||
@@ -194,28 +193,28 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
.Select(plan => new InstitutionPlanViewModel
|
||||
{
|
||||
CountPerson = plan.CountPerson,
|
||||
|
||||
|
||||
ContractAndCheckoutDouble = command.ContractAndCheckout ?
|
||||
((dailyWage * planPercentage.ContractAndCheckoutPercent / 100) * plan.CountPerson * plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
InsuranceDouble = command.Insurance ? (((dailyWage * planPercentage.InsurancePercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
RollCallDouble = command.RollCall ? (((dailyWage * planPercentage.RollCallPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
CustomizeCheckoutDouble =command.CustomizeCheckout ? (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
|
||||
CustomizeCheckoutDouble = (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage),
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
InsuranceInPersonDouble = command.InsuranceInPerson ? (((dailyWage * planPercentage.InsuranceInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
if (planByCountPerson == null)
|
||||
if(planByCountPerson == null)
|
||||
return new InstitutionPlanViewModel();
|
||||
//مبلغ کل خدمات حضوری
|
||||
var inPersonSumAmount = planByCountPerson.ContractAndCheckoutDouble + planByCountPerson.InsuranceDouble +
|
||||
@@ -237,7 +236,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
{
|
||||
CountPerson = planByCountPerson.CountPerson,
|
||||
|
||||
ContractAndCheckout = planByCountPerson.ContractAndCheckoutDouble > 0 ? planByCountPerson.ContractAndCheckoutDouble.ToMoney() : "0",
|
||||
ContractAndCheckout = planByCountPerson.ContractAndCheckoutDouble > 0 ? planByCountPerson.ContractAndCheckoutDouble.ToMoney() : "0",
|
||||
|
||||
Insurance = planByCountPerson.InsuranceDouble > 0 ? planByCountPerson.InsuranceDouble.ToMoney() : "0",
|
||||
|
||||
@@ -260,7 +259,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
return new InstitutionPlanViewModel();
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ public class ReportRepository : IReportRepository
|
||||
var allCheckoutToBeTople = allCheckoutLeftworks.Select(x => new { x.EmployeeId, x.WorkshopId }).ToList();
|
||||
//تمام تصفیه حساب های ایجاد شده ماه مورد نظر
|
||||
var allCheckoutCreated = _context.CheckoutSet
|
||||
.Where(x => allCheckoutLeftworkEmployeeIds.Contains(x.EmployeeId))
|
||||
.Where(x => allCheckoutLeftworkEmployeeIds.Contains(x.EmployeeId) && allCheckoutLeftworkWorkshopIds.Contains(x.WorkshopId))
|
||||
.Where(x =>
|
||||
x.ContractStart.Date >= currentMonthStart.Date && x.ContractEnd.Date <= currentMonthEnd.Date && x.IsActiveString == "true");
|
||||
|
||||
@@ -404,7 +404,7 @@ public class ReportRepository : IReportRepository
|
||||
var allContracToBeTople = allContractLeftworks.Select(x => new { x.EmployeeId, x.WorkshopId }).ToList();
|
||||
var allContractLeftworkWorkshopIds = allContractLeftworks.Select(x => x.WorkshopId).ToList();
|
||||
var allContractCreated = _context.Contracts
|
||||
.Where(x => allContractLeftworkEmployeeIds.Contains(x.EmployeeId))
|
||||
.Where(x => allContractLeftworkEmployeeIds.Contains(x.EmployeeId) && allContractLeftworkWorkshopIds.Contains(x.WorkshopIds))
|
||||
.Where(x =>
|
||||
x.ContarctStart.Date <= nextMonthEnd.Date && x.ContractEnd.Date > nextMonthStart.Date && x.IsActiveString == "true");
|
||||
var allContractCreatedlist = allContractCreated.Select(x => x.WorkshopIds).ToList();
|
||||
|
||||
@@ -6,6 +6,8 @@ using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.RollCallEmployeeStatusAgg;
|
||||
using Company.Domain.RollCallServiceAgg;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
@@ -20,16 +22,86 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
private readonly CompanyContext _context;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
|
||||
private IRollCallServiceRepository _rollCallServiceRepository;
|
||||
|
||||
private IRollCallEmployeeStatusRepository _employeeRollCallStatusRepository;
|
||||
// private IRollCallEmployeeRepository _rollCallEmployeeRepositoryImplementation;
|
||||
|
||||
public RollCallEmployeeRepository(CompanyContext context, IPasswordHasher passwordHasher,
|
||||
IWebHostEnvironment webHostEnvironment) : base(context)
|
||||
IWebHostEnvironment webHostEnvironment, IRollCallServiceRepository rollCallServiceRepository, IRollCallEmployeeStatusRepository employeeRollCallStatusRepository) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_passwordHasher = passwordHasher;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_rollCallServiceRepository = rollCallServiceRepository;
|
||||
_employeeRollCallStatusRepository = employeeRollCallStatusRepository;
|
||||
}
|
||||
|
||||
|
||||
public bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
//موقت
|
||||
// دادمهرگستر 11 *
|
||||
//585 کاشی گالری سرامیس (بابک ابراهیمی )
|
||||
//آموزشگاه ملل 604 *
|
||||
//کاریابی ملل 605 *
|
||||
//368 پیتزا امیر آماده سازی
|
||||
//367 پیتزا امیر رستوران
|
||||
//286 مرکز توان بخشی رسالت *
|
||||
//610 بیمارستان پارس - رازقی طعام
|
||||
DateTime start1404 = new DateTime(2025, 03, 21);
|
||||
bool skipRollCallByWorkshopId = false;
|
||||
if (contractStart < start1404)
|
||||
{
|
||||
skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367 or 286;
|
||||
}
|
||||
else
|
||||
{
|
||||
skipRollCallByWorkshopId = workshopId is 368 or 367 or 585 or 610;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//#if DEBUG
|
||||
// skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367;
|
||||
//#endif
|
||||
if (skipRollCallByWorkshopId)
|
||||
return false;
|
||||
|
||||
|
||||
// 42550 مصطفی مقدس نژاد فومنی
|
||||
bool skipRollCallByEmployeeId = employeeId is 42550;
|
||||
if (skipRollCallByEmployeeId)
|
||||
return false;
|
||||
|
||||
//9211 محسا تازه
|
||||
if (employeeId == 9211 && contractStart >= start1404)
|
||||
return false;
|
||||
|
||||
var service = _rollCallServiceRepository.GetAllServiceByWorkshopId(workshopId);
|
||||
|
||||
if (!service.Any(x => x.StartService.Date <= contractStart.Date && x.EndService.Date >= contractEnd.Date))
|
||||
return false;
|
||||
//var rollCallEmployee = GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
|
||||
//if (rollCallEmployee == null)
|
||||
// return false;
|
||||
var rollCallEmployee = _context.RollCallEmployees
|
||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
|
||||
.Include(x => x.EmployeesStatus);
|
||||
if (!rollCallEmployee.Any())
|
||||
return false;
|
||||
|
||||
var a = rollCallEmployee.Any(x => x.EmployeesStatus.Any(s =>
|
||||
(s.StartDate <= contractStart.Date && s.EndDate.Date >= contractEnd.Date) ||
|
||||
(s.StartDate.Date <= contractStart.Date && s.EndDate.Date > contractStart.Date)));
|
||||
//var result = _employeeRollCallStatusRepository.w(x => x.RollCallEmployeeId == rollCallEmployee.Id &&
|
||||
// (x.StartDate.Date <= contractStart.Date && x.EndDate.Date >= contractEnd.Date) ||
|
||||
// (x.StartDate.Date <= contractStart.Date && x.EndDate.Date > contractStart.Date));
|
||||
return a;
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
|
||||
{
|
||||
var query = _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel()
|
||||
|
||||
@@ -33,6 +33,7 @@ using CompanyManagment.App.Contracts.Reward.Enums;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
using Company.Domain.HolidayItemAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using PersianTools.Core;
|
||||
|
||||
|
||||
@@ -49,6 +50,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
private readonly TestDbContext _testDbContext;
|
||||
|
||||
|
||||
|
||||
public RollCallMandatoryRepository(CompanyContext context, IYearlySalaryRepository yearlySalaryRepository,
|
||||
ILeftWorkRepository leftWorkRepository, ILeaveRepository leaveRepository, IHolidayItemRepository holidayItemRepository, TestDbContext testDbContext) : base(context)
|
||||
{
|
||||
@@ -58,6 +60,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
_leaveRepository = leaveRepository;
|
||||
_holidayItemRepository = holidayItemRepository;
|
||||
_testDbContext = testDbContext;
|
||||
|
||||
}
|
||||
|
||||
#region OfficialChckout
|
||||
@@ -105,8 +108,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
.Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
//اگر ساعت استراحت پرسنل وجود نداشت صفر است
|
||||
var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
|
||||
|
||||
var breakTimeEntity = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
|
||||
var endOfFarvardin = "1404/01/31".ToGeorgianDateTime();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -142,16 +145,31 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
BreakTimeSpan = x.BreakTimeSpan
|
||||
}).ToList();
|
||||
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x =>
|
||||
{
|
||||
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))),
|
||||
TimeSpan breakTime;
|
||||
if (contractStart > endOfFarvardin)
|
||||
{
|
||||
breakTime = CalculateBreakTime(
|
||||
x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
|
||||
}
|
||||
else
|
||||
{
|
||||
breakTime = CalculateBreakTime(breakTimeEntity, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
|
||||
}
|
||||
return 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)) - breakTime,
|
||||
|
||||
BreakTime = breakTime,
|
||||
};
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
}
|
||||
|
||||
@@ -724,6 +742,55 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
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)
|
||||
{
|
||||
List<RollCallViewModel> rollCallResult = new List<RollCallViewModel>();
|
||||
@@ -887,19 +954,19 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
|
||||
|
||||
|
||||
//public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
|
||||
//{
|
||||
// if (breakTime.BreakTimeType != BreakTimeType.WithTime)
|
||||
// return new TimeSpan();
|
||||
public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
|
||||
{
|
||||
if (breakTime.BreakTimeType != BreakTimeType.WithTime)
|
||||
return new TimeSpan();
|
||||
|
||||
// var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
|
||||
var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
|
||||
|
||||
// if (breakTimeSpan * 2 >= sumOneDaySpan)
|
||||
// return new TimeSpan();
|
||||
if (breakTimeSpan * 2 >= sumOneDaySpan)
|
||||
return new TimeSpan();
|
||||
|
||||
// return breakTimeSpan; ;
|
||||
return breakTimeSpan; ;
|
||||
|
||||
//}
|
||||
}
|
||||
public static TimeSpan CalculateBreakTime(TimeSpan breakTimeSpan, TimeSpan sumOneDaySpan)
|
||||
{
|
||||
if (breakTimeSpan * 2 >= sumOneDaySpan)
|
||||
@@ -2038,7 +2105,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
var starTimeSingel1 = Convert.ToDateTime(shift1Start);
|
||||
var endTimeSingel2 = Convert.ToDateTime(shift1End);
|
||||
|
||||
bool hasRestTime = false;
|
||||
bool hasRestTime = false;
|
||||
|
||||
|
||||
shift1StartGr = new DateTime(cuurentDate.Year, cuurentDate.Month, cuurentDate.Day, starTimeSingel1.Hour, starTimeSingel1.Minute, 0);
|
||||
@@ -2047,92 +2114,92 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
if (shift1EndGr.TimeOfDay < shift1StartGr.TimeOfDay)
|
||||
shift1EndGr = shift1EndGr.AddDays(1);
|
||||
|
||||
var shiftEndWithoutRest = shift1EndGr;
|
||||
var shiftEndWithoutRest = shift1EndGr;
|
||||
|
||||
var shiftSpan = (shift1EndGr - shift1StartGr);
|
||||
if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
|
||||
{
|
||||
hasRestTime = true;
|
||||
shift1EndGr = shift1EndGr.Subtract(restTime);
|
||||
shiftSpan = (shift1EndGr - shift1StartGr);
|
||||
|
||||
}
|
||||
var shiftSpan = (shift1EndGr - shift1StartGr);
|
||||
if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
|
||||
{
|
||||
hasRestTime = true;
|
||||
shift1EndGr = shift1EndGr.Subtract(restTime);
|
||||
shiftSpan = (shift1EndGr - shift1StartGr);
|
||||
|
||||
if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType =="روزانه"))
|
||||
{
|
||||
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x =>
|
||||
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی");
|
||||
if (hourseLeaveTypeResult == null)
|
||||
{
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = shiftSpan,
|
||||
ShiftDate = shift1StartGr,
|
||||
}
|
||||
|
||||
if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "روزانه"))
|
||||
{
|
||||
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x =>
|
||||
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی");
|
||||
if (hourseLeaveTypeResult == null)
|
||||
{
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = shiftSpan,
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = hourseLeaveTypeResult.EndLeaveGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = hourseLeaveTypeResult.EndLeaveGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = hourseLeaveTypeResult.EndLeaveGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = hourseLeaveTypeResult.EndLeaveGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -2263,6 +2330,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region CustomizeCheckout
|
||||
|
||||
/// <summary>
|
||||
@@ -2968,13 +3036,13 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
|
||||
|
||||
var endFarvarding = new DateTime(2025, 4, 20);
|
||||
if (contractStart>endFarvarding)
|
||||
if (contractStart > endFarvarding)
|
||||
{
|
||||
customizeWorkshopEmployeeSettings=_context.CustomizeWorkshopEmployeeSettings
|
||||
customizeWorkshopEmployeeSettings = _context.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery().AsNoTracking().FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
|
||||
customizeWorkshopSettings =_context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
customizeWorkshopSettings = _context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -3929,40 +3997,40 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
return _context.Loans
|
||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
|
||||
.SelectMany(x => x.LoanInstallments)
|
||||
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
|
||||
.Select(x => new LoanInstallmentViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
Month = x.Month,
|
||||
IsActive = x.IsActive,
|
||||
Amount = x.AmountForMonth.ToMoney(),
|
||||
Year = x.Year,
|
||||
AmountDouble = x.AmountForMonth,
|
||||
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
|
||||
.Sum(i => i.AmountForMonth).ToMoney(),
|
||||
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
|
||||
}).ToList();
|
||||
}
|
||||
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
return _context.Loans
|
||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
|
||||
.SelectMany(x => x.LoanInstallments)
|
||||
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
|
||||
.Select(x => new LoanInstallmentViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
Month = x.Month,
|
||||
IsActive = x.IsActive,
|
||||
Amount = x.AmountForMonth.ToMoney(),
|
||||
Year = x.Year,
|
||||
AmountDouble = x.AmountForMonth,
|
||||
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
|
||||
.Sum(i => i.AmountForMonth).ToMoney(),
|
||||
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
|
||||
{
|
||||
return _context.SalaryAids
|
||||
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
CalculationDateTimeGe = x.CalculationDate,
|
||||
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
|
||||
Id = x.id
|
||||
}).ToList();
|
||||
}
|
||||
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
|
||||
{
|
||||
return _context.SalaryAids
|
||||
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
CalculationDateTimeGe = x.CalculationDate,
|
||||
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
|
||||
Id = x.id
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
private void CreateRewardForBirthDay(long employeeId, long workshopId, double amount, int month, int year,
|
||||
DateTime contractStart)
|
||||
|
||||
@@ -152,16 +152,16 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
public List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay)
|
||||
{
|
||||
var firstDayOfMonth = $"{startMonthDay.ToFarsi().Substring(0,8)}01".ToGeorgianDateTime();
|
||||
|
||||
var endFarvardin = "1404/01/31".ToGeorgianDateTime();
|
||||
//گرفتن ساعت استراحت پرسنل از تنظیمات
|
||||
#region breakTime
|
||||
//BaseCustomizeEntity settings = _context.CustomizeWorkshopEmployeeSettings.AsSplitQuery().FirstOrDefault(x =>
|
||||
// x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
////اگر ساعت استراحت پرسنل وجود نداشت صفر است
|
||||
//var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
|
||||
BaseCustomizeEntity settings = _context.CustomizeWorkshopEmployeeSettings.AsSplitQuery().FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
//اگر ساعت استراحت پرسنل وجود نداشت صفر است
|
||||
var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
|
||||
#endregion
|
||||
|
||||
var rollCalls = _context.RollCalls.Where(x =>
|
||||
var rollCalls = _context.RollCalls.Where(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null && x.RollCallModifyType != RollCallModifyType.Undefined &&
|
||||
x.ShiftDate.Date >= startMonthDay && x.ShiftDate.Date <= endMonthDay).ToList();
|
||||
|
||||
@@ -224,26 +224,30 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
|
||||
var rollCallTimeSpanPerDay =
|
||||
new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate - y.StartDate)!.Value.Ticks));
|
||||
var breakTimePerDay = RollCallMandatoryRepository.CalculateBreakTime(x.First().BreakTimeSpan, rollCallTimeSpanPerDay);
|
||||
TimeSpan breakTimePerDay ;
|
||||
if(startMonthDay>endFarvardin)
|
||||
breakTimePerDay= RollCallMandatoryRepository.CalculateBreakTime(x.First().BreakTimeSpan, rollCallTimeSpanPerDay);
|
||||
else
|
||||
breakTimePerDay = RollCallMandatoryRepository.CalculateBreakTime(breakTime, rollCallTimeSpanPerDay);
|
||||
|
||||
return new CheckoutDailyRollCallViewModel()
|
||||
{
|
||||
StartDate1 = orderedRollcalls.FirstOrDefault().StartDate.Value.ToString("HH:mm"),
|
||||
EndDate1 = orderedRollcalls.FirstOrDefault().EndDate.Value.ToString("HH:mm"),
|
||||
{
|
||||
StartDate1 = orderedRollcalls.FirstOrDefault().StartDate.Value.ToString("HH:mm"),
|
||||
EndDate1 = orderedRollcalls.FirstOrDefault().EndDate.Value.ToString("HH:mm"),
|
||||
|
||||
StartDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.StartDate?.ToString("HH:mm") ?? "",
|
||||
EndDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.EndDate?.ToString("HH:mm") ?? "",
|
||||
StartDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.StartDate?.ToString("HH:mm") ?? "",
|
||||
EndDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.EndDate?.ToString("HH:mm") ?? "",
|
||||
|
||||
TotalhourseSpan = rollCallTimeSpanPerDay - breakTimePerDay,
|
||||
TotalhourseSpan = rollCallTimeSpanPerDay - breakTimePerDay,
|
||||
|
||||
BreakTimeTimeSpan = breakTimePerDay,
|
||||
BreakTimeTimeSpan = breakTimePerDay,
|
||||
|
||||
DayOfWeek = x.Key.DayOfWeek.DayOfWeeKToPersian(),
|
||||
RollCallDateFa = x.Key.Date.ToFarsi(),
|
||||
DateTimeGr = x.Key.Date,
|
||||
IsSliced = x.Count() > 2,
|
||||
IsAbsent = false
|
||||
};
|
||||
DayOfWeek = x.Key.DayOfWeek.DayOfWeeKToPersian(),
|
||||
RollCallDateFa = x.Key.Date.ToFarsi(),
|
||||
DateTimeGr = x.Key.Date,
|
||||
IsSliced = x.Count() > 2,
|
||||
IsAbsent = false
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -117,21 +117,29 @@ public class SalaryAidRepository : RepositoryBase<long, SalaryAid>, ISalaryAidRe
|
||||
}
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
var list = query.ToList().Select(x => new SalaryAidViewModel
|
||||
var list = query.ToList().Select(x =>
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
Id = x.id,
|
||||
MonthFa = pc.GetMonth(x.CalculationDate).ToFarsiMonthByIntNumber(),
|
||||
YearFa = pc.GetYear(x.CalculationDate).ToString(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
WorkshopId = x.WorkshopId
|
||||
|
||||
var monthInt = pc.GetMonth(x.CalculationDate);
|
||||
var yearInt = pc.GetYear(x.CalculationDate);
|
||||
return new SalaryAidViewModel
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
Id = x.id,
|
||||
MonthFa = monthInt.ToFarsiMonthByIntNumber(),
|
||||
YearFa = yearInt.ToString(),
|
||||
Month = monthInt,
|
||||
Year = yearInt,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode
|
||||
.ToString(),
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
WorkshopId = x.WorkshopId,
|
||||
CalculationDateTimeGe = x.CalculationDate
|
||||
};
|
||||
}).ToList();
|
||||
result.GroupedByDate = list.GroupBy(x => new { x.YearFa, x.MonthFa }).Select(x =>
|
||||
new SalaryAidGroupedByDateViewModel()
|
||||
@@ -144,10 +152,12 @@ public class SalaryAidRepository : RepositoryBase<long, SalaryAid>, ISalaryAidRe
|
||||
EmployeeName = s.EmployeeFullName,
|
||||
Id = s.Id,
|
||||
PersonnelCode = s.PersonnelCode,
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
||||
}).ToList(),
|
||||
Year = x.First().Year,
|
||||
Month = x.First().Month,
|
||||
TotalAmount = x.Sum(s => s.AmountDouble).ToMoney()
|
||||
}).ToList();
|
||||
}).OrderByDescending(x => x.Year).ThenByDescending(x=>x.Month).ToList();
|
||||
return result;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.StartDate) &&
|
||||
@@ -187,7 +197,7 @@ public class SalaryAidRepository : RepositoryBase<long, SalaryAid>, ISalaryAidRe
|
||||
query = query.Where(x => x.SalaryAidDateTime >= startDate && x.SalaryAidDateTime <= endDate);
|
||||
}
|
||||
|
||||
result.SalaryAidListViewModels = query.OrderByDescending(x => x.CreationDate).Skip(searchModel.PageIndex).Take(30).ToList().Select(
|
||||
result.SalaryAidListViewModels = query.OrderByDescending(x => x.SalaryAidDateTime).Skip(searchModel.PageIndex).Take(30).ToList().Select(
|
||||
x => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
|
||||
@@ -1,31 +1,50 @@
|
||||
using _0_Framework.InfraStructure;
|
||||
using System;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.WorkshopSubAccountAgg;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using AccountManagement.Domain.SubAccountAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class WorkshopSubAccountRepository : RepositoryBase<long, WorkshopSubAccount>, IWorkshopSubAccountRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
public WorkshopSubAccountRepository(CompanyContext context, CompanyContext companyContext) : base(context)
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
|
||||
public WorkshopSubAccountRepository(CompanyContext context, CompanyContext companyContext, IEmployeeRepository employeeRepository) : base(context)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
_employeeRepository = employeeRepository;
|
||||
}
|
||||
|
||||
public List<WorkshopSubAccountViewModel> GetWorkshopsBySubAccountId(long subAccountId)
|
||||
{
|
||||
return _companyContext.WorkshopSubAccounts.Include(x => x.Workshop).Where(x => x.SubAccountId == subAccountId)
|
||||
.Select(x => new WorkshopSubAccountViewModel()
|
||||
var dateNow = DateTime.Today;
|
||||
|
||||
var viewModelList = _companyContext.WorkshopSubAccounts
|
||||
.Include(x => x.Workshop)
|
||||
.Where(x => x.SubAccountId == subAccountId)
|
||||
.Select(sub => new WorkshopSubAccountViewModel
|
||||
{
|
||||
SubAccountId = x.SubAccountId,
|
||||
IsActive = x.IsActive.ToString(),
|
||||
WorkshopId = x.WorkshopId,
|
||||
WorkshopName = x.Workshop.WorkshopName,
|
||||
SubAccountId = sub.SubAccountId,
|
||||
IsActive = sub.IsActive.ToString(),
|
||||
WorkshopId = sub.WorkshopId,
|
||||
WorkshopName = sub.Workshop.WorkshopFullName,
|
||||
})
|
||||
.ToList();
|
||||
|
||||
viewModelList.ForEach(x =>
|
||||
{
|
||||
x.PersonnelCount = _employeeRepository.GetWorkingEmployeesByWorkshopId(x.WorkshopId).Count();
|
||||
});
|
||||
|
||||
return viewModelList;
|
||||
}
|
||||
|
||||
public List<WorkshopSubAccount> GetWorkshopsSubAccountEntityBySubAccountId(long subAccountId)
|
||||
|
||||
@@ -40,11 +40,5 @@ public class WorkshopTempRepository : RepositoryBase<long, WorkshopTemp>, IWorks
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task RemoveWorkshopTemps(List<long> workshopTempIds)
|
||||
{
|
||||
var result = _context.WorkshopTemps.Where(x => workshopTempIds.Contains(x.id));
|
||||
|
||||
_context.RemoveRange(result);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -205,8 +205,6 @@ using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
@@ -429,14 +427,8 @@ public class PersonalBootstrapper
|
||||
services.AddTransient<ILeftWorkTempRepository, LeftWorkTempRepository>();
|
||||
services.AddTransient<ILeftWorkTempApplication, LeftWorkTempApplication>();
|
||||
|
||||
services.AddTransient<IContactUsRepository, ContactUsRepository>();
|
||||
services.AddTransient<IContactUsApplication, ContactUsApplication>();
|
||||
|
||||
services.AddTransient<IEmployeeAuthorizeTempRepository, EmployeeAuthorizeTempRepository>();
|
||||
|
||||
|
||||
services.AddTransient<IContactUsRepository, ContactUsRepository>();
|
||||
services.AddTransient<IContactUsApplication, ContactUsApplication>();
|
||||
services.AddTransient<IAdminMonthlyOverviewRepository, AdminMonthlyOverviewRepository>();
|
||||
services.AddTransient<IAdminMonthlyOverviewApplication, AdminMonthlyOverviewApplication>();
|
||||
#endregion
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.level4 {
|
||||
margin-right: 120px;
|
||||
}
|
||||
|
||||
.parent {
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
min-width: 220px;
|
||||
@@ -42,6 +46,16 @@
|
||||
border: 1px solid #666666 !important;
|
||||
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 {
|
||||
position: relative !important;
|
||||
top: 4px !important;
|
||||
@@ -536,15 +550,45 @@
|
||||
<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="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
||||
</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>
|
||||
<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 class="child-check level3">
|
||||
<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 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 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">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
@@ -810,23 +854,47 @@
|
||||
|
||||
</div>
|
||||
@* بررسی مدارک پرسنل *@
|
||||
<div class="parent-check">
|
||||
<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>
|
||||
<div class="parent-check">
|
||||
<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 parent"> <input type="checkbox" value="1100" class="check-btn"> <span style="bottom: 2px;position: relative"> برسی مدارک پرسنل </span> </label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parent"> <input type="checkbox" value="1100" class="check-btn"> <span style="bottom: 2px;position: relative"> برسی مدارک پرسنل </span> </label>
|
||||
|
||||
|
||||
@* <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="801" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست مشاغل مقطوع </span> </label>
|
||||
|
||||
|
||||
</div> *@
|
||||
</div>
|
||||
@* امور ماهیانه پرسنل *@
|
||||
<div class="parent-check">
|
||||
<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 parent"> <input type="checkbox" value="500" class="check-btn"> <span style="bottom: 2px;position: relative"> امور ماهیانه پرسنل </span> </label>
|
||||
|
||||
|
||||
|
||||
<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="501" class="check-btn"> <span style="bottom: 2px;position: relative"> مرحله بعد </span> </label>
|
||||
|
||||
</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="502" class="check-btn"> <span style="bottom: 2px;position: relative"> مرحله قبل </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
<div id="hiddenInput" style="display: none">
|
||||
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.level4 {
|
||||
margin-right: 120px;
|
||||
}
|
||||
|
||||
|
||||
.parent {
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
min-width: 220px;
|
||||
@@ -42,6 +47,15 @@
|
||||
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 {
|
||||
position: relative !important;
|
||||
top: 4px !important;
|
||||
@@ -478,7 +492,15 @@
|
||||
</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">
|
||||
<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"/>
|
||||
@@ -539,15 +561,45 @@
|
||||
<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="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
||||
</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>
|
||||
<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 class="child-check level3">
|
||||
<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 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 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">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
@@ -820,13 +872,38 @@
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parent"> <input type="checkbox" value="1100" class="check-btn"> <span style="bottom: 2px;position: relative"> برسی مدارک پرسنل </span> </label>
|
||||
|
||||
|
||||
@* <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="801" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست مشاغل مقطوع </span> </label>
|
||||
|
||||
</div> *@
|
||||
</div>
|
||||
|
||||
@* امور ماهیانه پرسنل *@
|
||||
<div class="parent-check">
|
||||
<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 parent"> <input type="checkbox" value="500" class="check-btn"> <span style="bottom: 2px;position: relative"> امور ماهیانه پرسنل </span> </label>
|
||||
|
||||
|
||||
<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="501" class="check-btn"> <span style="bottom: 2px;position: relative"> مرحله بعد </span> </label>
|
||||
|
||||
|
||||
</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="502" class="check-btn"> <span style="bottom: 2px;position: relative"> مرحله قبل </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using _0_Framework.Application
|
||||
@model ServiceHost.Areas.Admin.Pages.Accounts.Account.IndexModel
|
||||
@inject IAuthHelper _AuthHelper;
|
||||
|
||||
@{
|
||||
|
||||
var i = 1;
|
||||
var j = 1;
|
||||
var r = 1;
|
||||
var permissionList = _AuthHelper.GetPermissions();
|
||||
//string colaps = "in";
|
||||
//string act = "active";
|
||||
}
|
||||
@@ -64,11 +66,11 @@
|
||||
<div class="row">
|
||||
<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>
|
||||
|
||||
</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>
|
||||
|
||||
</p>
|
||||
@@ -99,17 +101,17 @@
|
||||
|
||||
<ul class="nav nav-tabs tabs" id="myTab">
|
||||
@* ============================================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">
|
||||
<span class="visible-xs">
|
||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
<span class="visible-xs">
|
||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
<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> نقش ها</h3>
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
@* ===============================================AdminTab=================*@
|
||||
<li class="tab active">
|
||||
<li class="tab active" permission="30604">
|
||||
<a href="#home-21" data-toggle="tab" aria-expanded="false" class="active ac">
|
||||
<span class="visible-xs">
|
||||
<i class="fa fa-user" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
@@ -119,20 +121,21 @@
|
||||
</a>
|
||||
</li>
|
||||
@* ===============================================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">
|
||||
<span class="visible-xs" >
|
||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
<span class="textMenu">لیست موازی</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>
|
||||
<span class="visible-xs" >
|
||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
<span class="textMenu">لیست کلاینت</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>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@*==================================================================Adminusers=====*@
|
||||
<div class="tab-pane active" id="home-21">
|
||||
<div class="tab-pane active" id="home-21" permission="30604">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -298,7 +301,7 @@
|
||||
</div>
|
||||
|
||||
@*==================================================================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>
|
||||
|
||||
@*==================================================================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="col-md-12">
|
||||
@@ -485,27 +488,27 @@
|
||||
j++;
|
||||
}
|
||||
<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>
|
||||
</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 })">
|
||||
<i class="fa fa-key faSize"></i>
|
||||
</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 })">
|
||||
<i class="fa fa-edit faSize"></i>
|
||||
</a>
|
||||
|
||||
@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>
|
||||
</a>
|
||||
}
|
||||
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>
|
||||
</a>
|
||||
}
|
||||
|
||||
@@ -221,6 +221,13 @@
|
||||
border-radius: 10px !important;
|
||||
|
||||
}
|
||||
|
||||
.hasCheckoutSet {
|
||||
background-color: #ffb715 !important;
|
||||
}
|
||||
.noExtention{
|
||||
background-color: #ffc8c8 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
}
|
||||
@@ -355,12 +362,14 @@
|
||||
</div>
|
||||
<div class="col-sm-4 pull-right" dir="rtl">
|
||||
<div class="form-group" id="start1" style="width: 100% !important; margin: 0 auto;">
|
||||
<input dir="ltr" disabled="disabled" id="sendStart" onchange="startValidcheck(this);" maxlength="10" style="text-align: center; width: 100%" placeholder="تاریخ شروع" class="form-control" asp-for="ContractStart"/>
|
||||
</div>
|
||||
<input dir="ltr" disabled="disabled" id="sendStartDisabled" onchange="startValidcheck(this);" maxlength="10" style="text-align: center; width: 100%" placeholder="تاریخ شروع" class="form-control" asp-for="ContractStart"/>
|
||||
<input type="hidden" id="sendStart" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4 pull-right" dir="rtl">
|
||||
<div class="form-group" id="end1" style="width: 100% !important; margin: 0 auto;">
|
||||
<input dir="ltr" disabled="disabled" id="sendEnd" onchange="endValidcheck(this);" maxlength="10" style="text-align: center;width: 100%" placeholder="تاریخ پایان" class="form-control" asp-for="ContractEnd"/>
|
||||
<input dir="ltr" disabled="disabled" id="sendEndDisabled" onchange="endValidcheck(this);" maxlength="10" style="text-align: center;width: 100%" placeholder="تاریخ پایان" class="form-control" asp-for="ContractEnd" />
|
||||
<input type="hidden" id="sendEnd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -424,12 +433,12 @@
|
||||
</th>
|
||||
<th style="font-size: 10px !important" class="sizeSet">شماره پرسنلی</th>
|
||||
<th style="font-size: 10px !important" class="sizeSet">شماره قرارداد</th>
|
||||
<th style="font-size: 10px !important" class="sizeSet"> کارفرما </th>
|
||||
<th style="font-size: 10px !important" class="sizeSet"> توضیحات </th>
|
||||
<th style="font-size: 10px !important" class="sizeSet">کارگاه</th>
|
||||
<th style="font-size: 10px !important" class="sizeSet"> پرسنل </th>
|
||||
<th style="font-size: 10px !important" class="sizeSet">آغاز قرارداد</th>
|
||||
<th style="font-size: 10px !important" class="sizeSet">پایان قرارداد</th>
|
||||
<th style="font-size: 10px !important" class="sizeSet"> - </th>
|
||||
<th style="font-size: 10px !important" class="sizeSet"> ترک کار </th>
|
||||
<th style="font-size: 10px !important" class="sizeSet"> - </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -475,11 +484,11 @@
|
||||
</div>
|
||||
</div>
|
||||
@* <script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script> *@
|
||||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
<script src="~/lib/select2/js/select2.js"></script>
|
||||
<script src="~/lib/select2/js/i18n/fa.js"></script>
|
||||
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
|
||||
|
||||
|
||||
|
||||
<link href="~/lib/select2/css/select2.css" rel="stylesheet"/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckoutListViewModel
|
||||
@{
|
||||
var i = 1;
|
||||
var b = 0;
|
||||
@@ -14,12 +14,12 @@
|
||||
|
||||
|
||||
|
||||
@if (Model.Contracts != null)
|
||||
@if (Model.CreateCheckoutList.Count > 0)
|
||||
{
|
||||
@foreach (var item in Model.Contracts)
|
||||
@foreach (var item in Model.CreateCheckoutList)
|
||||
{
|
||||
<tr class="mytable">
|
||||
@if (item.RedColor)
|
||||
<tr class="mytable @(!item.Extension && !item.HasCheckout ? "noExtention" : "") @(item.HasCheckout ? "hasCheckoutSet" : "") ">
|
||||
@* @if (item.RedColor)
|
||||
{
|
||||
<input type="hidden" name="redColor"/>
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
else if (item.Waiting && item.MoreThanOneMonth)
|
||||
{
|
||||
<input type="hidden" value="@item.EmployeeName" name="MixWatingAndMore"/>
|
||||
}
|
||||
} *@
|
||||
|
||||
<td style="font-size: 12px !important; text-align: center">
|
||||
@i
|
||||
@@ -42,23 +42,18 @@
|
||||
|
||||
<td style="font-size: 12px !important; text-align: center">
|
||||
|
||||
@if (item.Extension)
|
||||
@if (!item.Extension)
|
||||
{
|
||||
<input type="checkbox" name="cheking" value="@item.Id" checked="checked"/>
|
||||
|
||||
|
||||
|
||||
b++;
|
||||
<input type="checkbox" value="@item.Id" disabled="disabled"/>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (item.RedColor)
|
||||
{
|
||||
<input type="checkbox" value="@item.Id" disabled="disabled"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" name="cheking" value="@item.Id"/>
|
||||
}
|
||||
<input type="checkbox" name="cheking" value="@item.Id" checked="checked"/>
|
||||
b++;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +83,7 @@
|
||||
|
||||
}
|
||||
}*@
|
||||
@item.EmployerName
|
||||
@item.Description
|
||||
</td>
|
||||
|
||||
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
|
||||
@@ -105,7 +100,7 @@
|
||||
|
||||
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
|
||||
|
||||
@item.ContarctStart
|
||||
@item.ContractStart
|
||||
|
||||
|
||||
|
||||
@@ -127,22 +122,9 @@
|
||||
</td>
|
||||
|
||||
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
|
||||
@if (item.RedColor == false)
|
||||
{
|
||||
<span style="color: #1e88e5;">
|
||||
|
||||
@item.NextMonthStart
|
||||
|
||||
|
||||
</span>
|
||||
}
|
||||
|
||||
@if (item.NextMonthStart == null)
|
||||
{
|
||||
<span style="visibility: hidden">####/##/##</span>
|
||||
}
|
||||
|
||||
|
||||
|
||||
<span>@item.LeftWorkDate</span>
|
||||
|
||||
</td>
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
|
||||
|
||||
@section Script {
|
||||
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
|
||||
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
|
||||
<script src="~/AdminTheme/assets/js/site.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,12 +25,12 @@
|
||||
height: 28cm;
|
||||
margin: 3mm 5mm 0 5mm; ">
|
||||
<div class="row" dir="rtl">
|
||||
<div class="col-xs-3 d-inline-block"></div>
|
||||
<div class="col-xs-6 d-inline-block text-center">
|
||||
<p style="font-size: 18px; font-family: 'IranNastaliq' !important; margin-top:0 !important;">بسمه تعالی</p>
|
||||
<p style="font-size: 15px; font-weight: bold; margin: 2px;">فیش حقوقی و رسید پرداخت حقوق</p>
|
||||
</div>
|
||||
<div class="col-xs-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; margin-top: 5px; width: 70%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
|
||||
<div class="col-xs-6 d-inline-block text-center">
|
||||
<p style="font-size: 18px; font-family: 'IranNastaliq' !important; margin-top:0 !important;">بسمه تعالی</p>
|
||||
<p style="font-size: 15px; font-weight: bold; margin: 2px;">فیش حقوقی و رسید پرداخت حقوق</p>
|
||||
</div>
|
||||
<div class="col-xs-3 d-inline-block"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,606 @@
|
||||
@using _0_Framework.Application
|
||||
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel
|
||||
|
||||
|
||||
|
||||
<div class="container container2" id="printThis">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<fieldset style="border: 1px solid black;
|
||||
padding: revert;
|
||||
border-radius: 10px;
|
||||
height: 28cm;
|
||||
margin: 3mm 5mm 0 5mm; ">
|
||||
<div class="row" dir="rtl">
|
||||
<div class="col-xs-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; margin-top: 5px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
|
||||
<div class="col-xs-6 d-inline-block text-center">
|
||||
<p style="margin-top:10px !important;font-size: 18px; font-family: 'IranNastaliq' !important; ">بسمه تعالی</p>
|
||||
<p style="font-size: 15px; font-weight: bold">فیش حقوقی و رسید پرداخت حقوق</p>
|
||||
</div>
|
||||
<div class="col-xs-3 d-inline-block"></div>
|
||||
</div>
|
||||
<div class="row" style="padding: 0px 12px;font-size: 14px; margin-bottom: 10px; ">
|
||||
<div class="row">
|
||||
<span style="width: 280px;padding: 0px 10px 0px 0px !important; float:right"><span>اینجانب <span> </span> <span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.EmployeeFullName</span> </span></span>
|
||||
<span style="margin-right: 5px; float:right">
|
||||
<span> نام پدر: </span>
|
||||
@if (string.IsNullOrWhiteSpace(@Model.FathersName))
|
||||
{
|
||||
<span style="visibility: hidden">"1111111111"</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.FathersName</span>
|
||||
|
||||
}
|
||||
</span>
|
||||
<span style="padding: 0px !important; float: left">
|
||||
|
||||
<span>به کد ملی:</span> <span> </span>
|
||||
@if (string.IsNullOrWhiteSpace(@Model.NationalCode))
|
||||
{
|
||||
<span style="margin-left: 15px; visibility: hidden">222333111</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="margin-left: 15px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.NationalCode</span>
|
||||
}
|
||||
|
||||
<span>متولد:</span> <span> </span>
|
||||
@if (string.IsNullOrWhiteSpace(@Model.DateOfBirth))
|
||||
{
|
||||
<span style="margin-left: 10px; visibility: hidden">1401/01/01</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="margin-left: 10px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.DateOfBirth</span>
|
||||
}
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12" style="font-size: 14px; text-align: justify">
|
||||
|
||||
@{
|
||||
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
|
||||
{
|
||||
<span> پـرسنل کارگاه<span> </span><span> </span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
|
||||
<span> </span>
|
||||
<span>به کارفرمایی <span> </span> آقای/خانم</span>
|
||||
<span> </span>
|
||||
<span> </span>
|
||||
if (@Model.EmployerList.Count > 1)
|
||||
{
|
||||
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
@Model.EmployerList[0].EmployerFullName <span>،</span>
|
||||
<span> </span>@Model.EmployerList[1].EmployerFullName
|
||||
@if (@Model.EmployerList.Count > 2)
|
||||
{
|
||||
<span>و غیره</span>
|
||||
}
|
||||
</span>
|
||||
<br />
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
@Model.EmployerList.FirstOrDefault().EmployerFullName
|
||||
</span>
|
||||
<br />
|
||||
}
|
||||
|
||||
}
|
||||
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
|
||||
{
|
||||
<span> پـرسنل شرکت/موسسه<span> </span><span> </span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
|
||||
<br />
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<span>کلیه حق السعی خود اعم از حقوق، کمک هزینه اقلام مصرفی خانوار، کمک هزینه مسکن </span>
|
||||
|
||||
<span>و همچنین عیدی و پاداش، سنوات و...</span>
|
||||
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> <span style="font-weight: bold">@Model.Month</span> ماه </span>
|
||||
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> سال <span style="font-weight: bold">@Model.Year</span> </span>
|
||||
<span> برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام. </span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row m-t-20">
|
||||
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
|
||||
<table style="/* table-layout: fixed; */ width: 100%">
|
||||
|
||||
|
||||
<tr style="border-bottom: 1px solid; height: 25px; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<th style="text-align: center; width: 8mm; font-size: 12px; padding: 2px; border-collapse: separate; border-radius: 0px 10px 0px 0px;"> </th>
|
||||
<th style="text-align: center; position: absolute ; right: 55mm; font-size: 13px;padding-top:4px"> مطالبات </th>
|
||||
<th style="text-align: center;"> </th>
|
||||
<th style="text-align: center; border-left: 2px solid #000; font-size: 12px"> </th>
|
||||
<th style="text-align: center; font-size: 13px; position: absolute; left: 50mm; padding-top: 4px;"> کسورات </th>
|
||||
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 0px 0px 0px 0px;"> </th>
|
||||
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 10px 0px 0px 0px;"> </th>
|
||||
</tr>
|
||||
|
||||
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important ;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<th style="width: 5%; text-align: center; border-left: 1px solid #000; font-size: 12px;padding: 2px"> ردیف </th>
|
||||
<th style="width: 23%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
|
||||
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
|
||||
<th style="width: 12%; text-align: center; border-left: 2px solid #000; font-size: 12px"> مبلغ(ریال) </th>
|
||||
<th style="width: 28%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
|
||||
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
|
||||
<th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="font-size: 12px; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">1</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حقوق و مزد </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @Model.SumOfWorkingDays </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MonthlySalary == "0" ? "-" : Model.MonthlySalary) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق بیمه سهم کارگر </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">2</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> پایه سنوات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.BaseYearsPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مالیات بر حقوق </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">3</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه اقلام مصرفی خانوار </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.ConsumableItems) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> قسط تسهیلات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">4</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه مسکن </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.HousingAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">5</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده اضافه کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverTimeWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverTimeWorkValue)) ? "-" : Model.OverTimeWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.OvertimePay == "0" || string.IsNullOrWhiteSpace(Model.OvertimePay)) ? "-" : Model.OvertimePay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> غیبت </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">6</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده شب کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverNightWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverNightWorkValue)) ? "-" : Model.OverNightWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.NightworkPay == "0" || string.IsNullOrWhiteSpace(Model.NightworkPay)) ? "-" : Model.NightworkPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">7</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده جمعه کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.FridayWorkValue == "0" || string.IsNullOrWhiteSpace(Model.FridayWorkValue)) ? "-" : Model.FridayWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.FridayPay == "0" || string.IsNullOrWhiteSpace(Model.FridayPay)) ? "-" : Model.FridayPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">8</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده ماموریت </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MissionPay == "0" ? "-" : Model.MissionPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">9</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده نوبت کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.RotatingShiftValue == "0" || string.IsNullOrWhiteSpace(Model.RotatingShiftValue)) ? "-" : "%" + Model.RotatingShiftValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ShiftPay == "0" ? "-" : Model.ShiftPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">10</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه عائله مندی </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.FamilyAllowance == "0" ? "-" : Model.FamilyAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">11</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق تاهل </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @Model.MaritalStatus </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MarriedAllowance == "0" ? "-" : Model.MarriedAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">12</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.RewardPay == "0" ? "-" : Model.RewardPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">13</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> عیدی و پاداش </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.BonusesPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">14</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> سنوات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.YearsPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">15</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مزد مرخصی </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.LeavePay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; height: 20px; background-color: #dddcdc !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; border-bottom: 1px solid #000; border-top: 1px solid #000; ">
|
||||
<td style="text-align: center; padding: 2px "></td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع مطالبات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalClaims == "0" ? "-" : Model.TotalClaims) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع کسورات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.TotalDeductions == "0" ? "-" : Model.TotalDeductions) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; border-radius: 0px 0px 10px 10px !important; height: 20px; background-color: #efefef !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; padding: 2px; border-radius: 0px 0px 10px 0px "></td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000; "> مبلغ قابل پرداخت </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalPayment == "0" ? "-" : Model.TotalPayment) </td>
|
||||
<td style="padding-right: 8px;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-radius:0px 0px 0px 10px"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div style="">
|
||||
<div class="" style="margin-top: 8px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
|
||||
<div class="" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%">
|
||||
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<tr style="font-size: 8px;border-collapse: separate;background-color: #AFAFAF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
<th style="font-size: 8px !important;width: 28%;padding: 2px 10px !important;border-left: 0;border-radius: 0 5px 5px 0 !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">تاریخ</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ورود</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">خروج</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ورود</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">خروج</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 11%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">استراحت</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 10%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">منقطع</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 15%;padding: 0 0 0 0px !important;border-radius: 5px 0 0 5px !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت کارکرد</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (int i = 0; i < 15; i++)
|
||||
{
|
||||
<tr style="@((@Model.MonthlyRollCall[i].IsHoliday || @Model.MonthlyRollCall[i].IsFriday) ? "background-color: #BBBBBB !important;" : "background-color: #FFFFFF !important;") font-size: 8px;border-collapse: separate;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 1px 3px;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid; border-radius: 0 5px 5px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].DateTimeGr.ToFarsi() - @Model.MonthlyRollCall[i].DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
|
||||
|
||||
|
||||
@if (@Model.MonthlyRollCall[i].IsAbsent)
|
||||
{
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<span style="width: 40px;display: block;border-radius: 50px;background-color: #737373;color: #fff;">غیبت</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
@* <span style="width: 40px;display: block;border-radius: 50px;background-color: #737373;color: #fff;">غیبت</span> *@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (string.IsNullOrWhiteSpace(Model.MonthlyRollCall[i].LeaveType))
|
||||
{
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].StartDate1</td>
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].EndDate1</td>
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].StartDate2</td>
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].EndDate2</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<span style="width: 41px; display: block; border-radius: 50px; background-color: #fff; color: #737373;border: 1px solid #737373;">
|
||||
@Model.MonthlyRollCall[i].LeaveType
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
@* <span style="width: 40px; display: block; border-radius: 50px; background-color: #fff; color: #737373;border: 1px solid #737373;">
|
||||
@Model.MonthlyRollCall[i].LeaveType
|
||||
</span> *@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].BreakTimeString</td>
|
||||
<td style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@if (@Model.MonthlyRollCall[i].IsSliced)
|
||||
{
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block; margin: auto;">
|
||||
<circle stroke-width="2" cx="12" cy="12" r="9" stroke="#222222" />
|
||||
<path stroke-width="2" d="M8 12L11 15L16 9" stroke="#222222" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>-</span>
|
||||
}
|
||||
</td>
|
||||
<td style="font-size: 8px;text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact;border-radius: 5px 0 0 5px;">@Model.MonthlyRollCall[i].TotalWorkingHours</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%">
|
||||
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<tr style="font-size: 8px;border-collapse: separate;background-color: #AFAFAF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
<th style="font-size: 8px !important;width: 28%;padding: 2px 10px !important;border-left: 0;border-radius: 0 5px 5px 0 !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">تاریخ</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ورود</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">خروج</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ورود</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">خروج</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 11%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">استراحت</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 10%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">منقطع</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 15%;padding: 0 0 0 0px !important;border-radius: 5px 0 0 5px !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت کارکرد</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{
|
||||
Model.MonthlyRollCall = Model.MonthlyRollCall.Skip(15).ToList();
|
||||
}
|
||||
@foreach (var day in Model.MonthlyRollCall)
|
||||
{
|
||||
<tr style="@((day.IsHoliday || day.IsFriday) ? "background-color: #BBBBBB !important;" : "background-color: #FFFFFF !important;") font-size: 8px;border-collapse: separate;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 1px 3px;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid; border-radius: 0 5px 5px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.DateTimeGr.ToFarsi() - @day.DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
|
||||
|
||||
|
||||
@if (day.IsAbsent)
|
||||
{
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<span style="width: 38px;display: block;border-radius: 50px;background-color: #737373;color: #fff;">غیبت</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
@* <span style="width: 40px;display: block;border-radius: 50px;background-color: #737373;color: #fff;">غیبت</span> *@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (string.IsNullOrWhiteSpace(day.LeaveType))
|
||||
{
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.StartDate1</td>
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.EndDate1</td>
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.StartDate2</td>
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.EndDate2</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<span style="width: 41px; display: block; border-radius: 50px; background-color: #fff; color: #737373;border: 1px solid #737373;">
|
||||
@day.LeaveType
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
@* <span style="width: 80px; display: block; border-radius: 50px; background-color: #fff; color: #737373;border: 1px solid #737373;">
|
||||
مرخصی @day.LeaveType
|
||||
</span> *@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
}
|
||||
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.BreakTimeString</td>
|
||||
<td style="font-size: 8px !important; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@if (day.IsSliced)
|
||||
{
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block; margin: auto;">
|
||||
<circle stroke-width="2" cx="12" cy="12" r="9" stroke="#222222" />
|
||||
<path stroke-width="2" d="M8 12L11 15L16 9" stroke="#222222" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>-</span>
|
||||
}
|
||||
</td>
|
||||
<td style="font-size: 8px;text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact;border-radius: 5px 0 0 5px;">@day.TotalWorkingHours</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<div style="background-color: #FFFFFF !important; border: 1px solid #CCCCCC;border-radius: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
|
||||
<tr style="font-size: 12px; border-collapse: separate; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 6px 6px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 0px;border-color: #D9D9D9;border-style: solid; border-radius: 6px 0 0 6px; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات کارکرد : @Model.TotalWorkingTimeStr</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="padding: 0 12px;">
|
||||
<table style="width: 100%;margin: 12px 0 0 0;">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td style="width: 60%;">
|
||||
@{
|
||||
if (Model.IsLeft)
|
||||
{
|
||||
<span style="float: right; margin-right: 15px; font-size: 11.2px;height: 36px;">
|
||||
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span><span> </span>
|
||||
<span>@Model.LastDayOfWork</span><span> </span>
|
||||
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span><span> </span>
|
||||
<span>@Model.LeftWorkDate</span><span> </span>
|
||||
<span>می باشد</span>
|
||||
</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
<td style="width: 40%;">
|
||||
<div style="display: flex; justify-content: end;" class="signSection">
|
||||
<div style="margin-left: 15px; position: relative; width: 80px; border: 1px solid #000; height: 78px; border-radius: 10px;">
|
||||
<span style="border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;font-size: 12px;margin: -10px 8px 0 0;display: table-caption;padding: 0 4px;white-space: nowrap;">اثر انگشت</span>
|
||||
</div>
|
||||
<div style="position: relative; width: 160px; border: 1px solid #000; height: 78px; border-radius: 10px;">
|
||||
<span style="border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;font-size: 12px;margin: -10px 54px 0 0;display: table-caption;padding: 0 4px;">امضاء</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@* <div class="row">
|
||||
<fieldset style="border-radius: 10px 10px 10px 10px; margin: 0px 10px;">
|
||||
<div class="row" style="padding: 10px 0 0px 0;">
|
||||
@{
|
||||
if (Model.IsLeft)
|
||||
{
|
||||
<span style="float: right; margin-right: 15px; font-size: 11.2px;height: 36px;">
|
||||
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span><span> </span>
|
||||
<span>@Model.LastDayOfWork</span><span> </span>
|
||||
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span><span> </span>
|
||||
<span>@Model.LeftWorkDate</span><span> </span>
|
||||
<span>می باشد</span>
|
||||
</span>
|
||||
}
|
||||
}
|
||||
|
||||
</div> *@
|
||||
|
||||
@* <div class="row" style="padding: 0px 14px; font-size: 14px;">
|
||||
<div class="row"> *@
|
||||
@*<div class="col-xs-3"><span>اینجانب <span> </span> <span> </span><span> </span><span style="font-weight: bold">@Model.EmployeeFullName</span> </span></div>
|
||||
<div class="col-xs-3"><span> نام پدر: <span> </span><span> </span> <span> </span><span style="font-weight: bold">@Model.FathersName</span></span></div>
|
||||
<div class="col-xs-3"><span>به کد ملی:<span> </span><span> </span><span style="font-weight: bold">@Model.NationalCode</span> </span></div>
|
||||
<div class="col-xs-3" style="direction: ltr"> متولد: <span> </span><span> </span><span> </span><span> </span><span style="font-weight: bold">@Model.DateOfBirth</span></div>*@
|
||||
@* </div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12" style="font-size: 14px; text-align: justify"> *@
|
||||
@*<span> پـرسنل شـرکت<span> </span><span> </span><span style="font-weight: bold">@Model.WorkshopName</span> </span>
|
||||
<span> </span>
|
||||
<span>به کارفرمایی <span> </span> آقای/خانم/شرکت</span> <span> </span><span> </span>
|
||||
@{
|
||||
foreach (var item in @Model.EmployerList)
|
||||
{
|
||||
<span style="font-weight: bold">@item.EmployerFullName </span> <span>،</span>
|
||||
}
|
||||
}
|
||||
<span> </span><span> </span>
|
||||
<span>مبلغ ............. ریال را بصورت نقدی از کارفرما دریافت نمودم. </span>*@
|
||||
|
||||
|
||||
|
||||
@* </div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div classs="col-xs-12">
|
||||
<div style="float: left;display: flex;position: absolute;left: 26px;bottom: 12px;">
|
||||
<div style="margin-left: 15px; position: relative; width: 80px; border: 1px solid #000; height: 98px; border-radius: 10px;">
|
||||
<span style="position: absolute; top: -9px; right: 50%; transform: translate(50%, 0px); border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; font-size: 12px;width: 55px;">اثر انگشت</span>
|
||||
</div>
|
||||
<div style="margin-left: 15px; position: relative; width: 160px; border: 1px solid #000; height: 98px; border-radius: 10px;">
|
||||
<span style="position: absolute; top: -9px; right: 50%; transform: translate(50%, 0px); border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; font-size: 12px;">امضاء</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
</div> *@
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" asp-for="Id" value="@Model.Id" />
|
||||
|
||||
<input type="hidden" id="shiftWorkval" name="shiftWorkval" value="@Model.CreateWorkingHoursTemp.ShiftWork">
|
||||
|
||||
|
||||
@@ -1483,8 +1483,8 @@ public class IndexModel : PageModel
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) || clientTemps.Any())
|
||||
//var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) /*|| clientTemps.Any()*/)
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
|
||||
@@ -1108,10 +1108,10 @@
|
||||
<td class="hidden-xs" style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center; width: 30px">
|
||||
@item.EmployeeCount
|
||||
</td>
|
||||
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
<td class="hidden-xs @(item.IsExpier == "true" ? "bgRed" : "")" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
@item.ContractStartFa
|
||||
</td>
|
||||
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
<td class="hidden-xs @(item.IsExpier == "true" ? "bgRed" : "")" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
@item.ContractEndFa
|
||||
</td>
|
||||
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
|
||||
@@ -91,7 +91,7 @@ public class IndexModel : PageModel
|
||||
new SelectList(_representativeApplication.GetRepresentatives(), "Id", "FullName");
|
||||
|
||||
InstitutionContracts = _institutionContract.NewSearch(searchModel)
|
||||
.OrderByDescending(x => x.IsActiveString == "blue").ThenByDescending(x => x.IsContractingPartyBlock)
|
||||
.OrderByDescending(x => x.IsActiveString == "blue").ThenByDescending(x => x.IsContractingPartyBlock == "true" && x.IsExpier == "false")
|
||||
.ToList();
|
||||
|
||||
var totalAmounts = InstitutionContracts.Where(x => x.IsActiveString == "true").Sum(x => x.SearchAmount);
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
var accountId = AuthHelper.CurrentAccountId();
|
||||
|
||||
}
|
||||
<div class="left side-menu">
|
||||
<div class="sidebar-inner slimscrollleft">
|
||||
@@ -177,19 +179,24 @@
|
||||
</svg>
|
||||
حضورغیاب </a>
|
||||
</li>
|
||||
<li permission="306">
|
||||
<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;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
بانک ها </a>
|
||||
</li>
|
||||
<li permission="306"><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;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
گزارش پیامک خودکار</a>
|
||||
</li>
|
||||
@if (accountId is 2 or 3)
|
||||
{
|
||||
<li permission="307">
|
||||
<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;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
بانک ها </a>
|
||||
</li>
|
||||
<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;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
گزارش پیامک خودکار</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
<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;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
@@ -455,7 +462,7 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li permission="500">
|
||||
<a asp-area="AdminNew" asp-page="/Company/MonthlyOverview/Index" class="waves-effect btnWorkFlow" style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<div class="menuTitle">
|
||||
<i class="md md-home"></i>
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IActionResult OnPostShiftDate()
|
||||
{
|
||||
//var startRollCall = new DateTime(2025, 2, 19);
|
||||
@@ -79,6 +80,40 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
ViewData["message"] = "تومام یک";
|
||||
return Page();
|
||||
}
|
||||
public async Task<IActionResult> OnPostShiftDateNew2()
|
||||
{
|
||||
//var startRollCall = new DateTime(2025, 3, 21);
|
||||
//var rollCalls = _context.RollCalls.Where(x => x.StartDate >= startRollCall && x.EndDate != null ).ToList();
|
||||
//var r1 = rollCalls.Skip(10000).Take(10000).ToList();
|
||||
|
||||
//Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
//Console.WriteLine("endStep 1 ============");
|
||||
//SetRollCall(r1);
|
||||
|
||||
await SetWorkshopRoleSubAccount();
|
||||
ViewData["message"] = "تومام دو";
|
||||
return Page();
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task SetWorkshopRoleSubAccount()
|
||||
{
|
||||
var subAccountRoles = _accountContext.SubAccountRoles.Include(x=>x.SubAccounts).ToList();
|
||||
|
||||
subAccountRoles.ForEach(role =>
|
||||
{
|
||||
var getSubAccount = role.SubAccounts.FirstOrDefault();
|
||||
if (getSubAccount != null)
|
||||
{
|
||||
var subAccount = getSubAccount.id;
|
||||
|
||||
var workshopIds = _context.WorkshopSubAccounts.Where(x => x.SubAccountId == subAccount).Select(x => x.WorkshopId).ToList();
|
||||
role.Edit(role.Title, role.RolePermissions.Select(x => x.PermissionCode).ToList(), workshopIds);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
await _accountContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
private void SetEntityIdForCheckoutValuesTemp()
|
||||
@@ -214,20 +249,6 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostShiftDateNew2()
|
||||
{
|
||||
//var startRollCall = new DateTime(2025, 3, 21);
|
||||
//var rollCalls = _context.RollCalls.Where(x => x.StartDate >= startRollCall && x.EndDate != null ).ToList();
|
||||
//var r1 = rollCalls.Skip(10000).Take(10000).ToList();
|
||||
|
||||
//Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
//Console.WriteLine("endStep 1 ============");
|
||||
//SetRollCall(r1);
|
||||
|
||||
await SetCalculationDateInSalaryAid();
|
||||
ViewData["message"] = "تومام دو";
|
||||
return Page();
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task SetCalculationDateInSalaryAid()
|
||||
{
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@model ServiceHost.Areas.AdminNew.Pages.Company.MonthlyOverview.IndexModel
|
||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
ViewData["Title"] = " - " + "کارگاه";
|
||||
|
||||
var hasNextPermission = AuthHelper.GetPermissions().Any(x => x == 501);
|
||||
var hasPrevPermission = AuthHelper.GetPermissions().Any(x => x == 502);
|
||||
}
|
||||
|
||||
@section Styles {
|
||||
@@ -41,82 +46,134 @@
|
||||
|
||||
|
||||
@* Search *@
|
||||
<div class="container-fluid d-block">
|
||||
<div class="row">
|
||||
<div class="search-box card">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="container-fluid d-none d-md-block">
|
||||
<div class="row">
|
||||
<div class="search-box card">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="tw-grid tw-grid-cols-2 md:tw-grid-cols-12 gap-2">
|
||||
<div class="">
|
||||
<select class="form-select" id="year-select" name="YearFa" asp-for="SearchModel.Year">
|
||||
<option value="0" disabled="disabled">سال</option>
|
||||
@foreach (var year in Model.YearlyList)
|
||||
{
|
||||
<option value=@year>@year</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="">
|
||||
<select class="form-select" id="month-select" name="MonthFa">
|
||||
<option value="0" disabled="disabled">ماه</option>
|
||||
<option value="1">فروردین</option>
|
||||
<option value="2">اردیبهشت</option>
|
||||
<option value="3">خرداد</option>
|
||||
<option value="4">تیر</option>
|
||||
<option value="5">مرداد</option>
|
||||
<option value="6">شهریور</option>
|
||||
<option value="7">مهر</option>
|
||||
<option value="8">آبان</option>
|
||||
<option value="9">آذر</option>
|
||||
<option value="10">دی</option>
|
||||
<option value="11">بهمن</option>
|
||||
<option value="12">اسفند</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select EmployerSelect2Option" aria-label="انتخاب کارفرما" id="employer-select" name="employerName">
|
||||
<option value="0">انتخاب کارفرما</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select WorkshopSelect2Option" aria-label="نام کارگاه /شماره بایگانی ..." id="workshop-select" data-selected-name="نام کارگاه /شماره بایگانی ..." >
|
||||
<option value="0"> نام کارگاه /شماره بایگانی </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select AdminPersonnelNameSelect2Option" aria-label="انتخاب اعضاء" id="admin-personnel-select" name="adminpersonnelName">
|
||||
<option value=""> انتخاب اعضاء </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="">
|
||||
<select class="form-select" id="status-select" name="status">
|
||||
<option value="2" selected="selected">فعال/غیر فعال</option>
|
||||
<option value="1">فعال</option>
|
||||
<option value="0">غیر فعال</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="">
|
||||
<select class="form-select" id="year-select" name="YearFa" asp-for="SearchModel.Year">
|
||||
<option value="0" disabled="disabled">سال</option>
|
||||
@foreach (var year in Model.YearlyList)
|
||||
{
|
||||
<option value=@year>@year</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="">
|
||||
<select class="form-select" id="month-select" name="MonthFa">
|
||||
<option value="0" disabled="disabled">ماه</option>
|
||||
<option value="1">فروردین</option>
|
||||
<option value="2">اردیبهشت</option>
|
||||
<option value="3">خرداد</option>
|
||||
<option value="4">تیر</option>
|
||||
<option value="5">مرداد</option>
|
||||
<option value="6">شهریور</option>
|
||||
<option value="7">مهر</option>
|
||||
<option value="8">آبان</option>
|
||||
<option value="9">آذر</option>
|
||||
<option value="10">دی</option>
|
||||
<option value="11">بهمن</option>
|
||||
<option value="12">اسفند</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select EmployerSelect2Option" aria-label="انتخاب کارفرما" id="employer-select" name="employerName">
|
||||
<option value="0">انتخاب کارفرما</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select WorkshopSelect2Option" aria-label="نام کارگاه /شماره بایگانی ..." id="workshop-select" data-selected-name="نام کارگاه /شماره بایگانی ..." >
|
||||
<option value="0"> نام کارگاه /شماره بایگانی </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select AdminPersonnelNameSelect2Option" aria-label="انتخاب اعضاء" id="admin-personnel-select" name="adminpersonnelName">
|
||||
<option value=""> انتخاب اعضاء </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="">
|
||||
<select class="form-select" id="status-select" name="status">
|
||||
<option value="2" selected="selected">فعال/غیر فعال</option>
|
||||
<option value="1">فعال</option>
|
||||
<option value="0">غیر فعال</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="tw-flex tw-items-center tw-col-span-2 gap-2">
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
|
||||
<span>جستجو</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white"/>
|
||||
<path d="M20 20L17 17" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="tw-flex tw-items-center tw-col-span-2 gap-2">
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
|
||||
<span>جستجو</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white"/>
|
||||
<path d="M20 20L17 17" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<a href="/AdminNew/Company/MonthlyOverview" class="tw-h-full btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
|
||||
<span>حذف جستجو</span>
|
||||
</a>
|
||||
<a href="/AdminNew/Company/MonthlyOverview" class="tw-h-full btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
|
||||
<span>حذف جستجو</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Advance Search Box -->
|
||||
<div class="tw-block md:tw-hidden tw-mb-1">
|
||||
<div class="tw-flex tw-items-center tw-justify-between">
|
||||
<div class="search-box tw-w-full tw-bg-white tw-p-2">
|
||||
<div class="tw-flex tw-items-center tw-justify-between tw-gap-2 tw-mb-2">
|
||||
<div class="tw-w-full">
|
||||
<select class="form-select" id="year-select-mobile" name="YearFa" asp-for="SearchModel.Year">
|
||||
<option value="0" disabled="disabled">سال</option>
|
||||
@foreach (var year in Model.YearlyList)
|
||||
{
|
||||
<option value=@year>@year</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-w-full">
|
||||
<select class="form-select" id="month-select-mobile" name="MonthFa">
|
||||
<option value="0" disabled="disabled">ماه</option>
|
||||
<option value="1">فروردین</option>
|
||||
<option value="2">اردیبهشت</option>
|
||||
<option value="3">خرداد</option>
|
||||
<option value="4">تیر</option>
|
||||
<option value="5">مرداد</option>
|
||||
<option value="6">شهریور</option>
|
||||
<option value="7">مهر</option>
|
||||
<option value="8">آبان</option>
|
||||
<option value="9">آذر</option>
|
||||
<option value="10">دی</option>
|
||||
<option value="11">بهمن</option>
|
||||
<option value="12">اسفند</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw-flex tw-justify-between tw-text-center">
|
||||
<button class="btn-search tw-flex tw-items-center tw-justify-center tw-w-full" type="button" data-bs-toggle="modal" data-bs-target="#searchModal">
|
||||
<span>جستجو پیشرفته</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white"/>
|
||||
<path d="M20 20L17 17" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@* TabBar *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Advance Search Box -->
|
||||
|
||||
|
||||
|
||||
|
||||
@* TabBar *@
|
||||
<div class="tw-overflow-x-auto tw-w-full custom-scrollbar-x mt-3">
|
||||
<div class="tab-bar tw-flex tw-gap-1 tw-whitespace-nowrap tw-w-max ">
|
||||
<button class="tab-bar__tab u-tactile tab-bar__tab--active js-document-click" value="0">
|
||||
@@ -152,7 +209,7 @@
|
||||
<div class="card-container tw-hidden md:tw-block" id="overviewSteps">
|
||||
@* Monthly Table Desktop *@
|
||||
<div class="monthly-table">
|
||||
<div class="monthly-table__head tw-font-[600] tw-mb-1 tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-bg-[#3B73D0] tw-px-2 tw-text-white tw-text-[14px]">
|
||||
<div class="monthly-table__head tw-font-[500] tw-mb-1 tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-bg-[linear-gradient(180deg,_#41D1D1_0%,_#2CD0D0_100%)] tw-px-2 tw-text-white tw-text-[13px]">
|
||||
<div class="monthly-table__head-cell tw-w-[2%]">ردیف</div>
|
||||
<div class="monthly-table__head-cell tw-w-[7%] tw-text-center">ش بایگانی</div>
|
||||
<div class="monthly-table__head-cell tw-w-[15%] tw-text-right">نام کارگاه</div>
|
||||
@@ -178,50 +235,52 @@
|
||||
|
||||
<div class="monthly-table__body tw-whitespace-nowrap" id="load-data-html-step4" style="display: none;">
|
||||
</div>
|
||||
|
||||
|
||||
<div id="loadingSkeleton" style="display: contents;">
|
||||
@for (int j = 0; j < 30; j++)
|
||||
{
|
||||
<div class="skeleton-loader" style="margin: 3px 0 !important;height: 35px;"></div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* The whole workshop Desktop *@
|
||||
<div class="card-container tw-hidden md:tw-block" id="overviewAll" style="display: none">
|
||||
<div class="monthly-table ">
|
||||
<div class="monthly-table__head tw-font-[600] tw-mb-1 tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-bg-[#3B73D0] tw-px-2 tw-text-white tw-text-[14px]">
|
||||
<div class="monthly-table">
|
||||
<div class="monthly-table__head tw-font-[500] tw-mb-1 tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-rounded-[5px] tw-bg-[linear-gradient(180deg,_#41D1D1_0%,_#2CD0D0_100%)] tw-px-2 tw-text-white tw-text-[13px]">
|
||||
<div class="monthly-table__head-cell tw-w-[2%]">ردیف</div>
|
||||
<div class="monthly-table__head-cell tw-w-[13%] tw-text-center">ش بایگانی</div>
|
||||
<div class="monthly-table__head-cell tw-w-[15%] tw-text-center">نام کارگاه</div>
|
||||
<div class="monthly-table__head-cell tw-w-[15%] tw-text-center">نام کارفرما</div>
|
||||
<div class="monthly-table__head-cell tw-w-[5%] tw-text-center">استان</div>
|
||||
<div class="monthly-table__head-cell tw-w-[5%] tw-text-center">شهرستان</div>
|
||||
<div class="monthly-table__head-cell tw-w-[35%] tw-text-center">جزئیات نشانی </div>
|
||||
|
||||
<div class="monthly-table__head-cell tw-w-[7%] tw-text-center">ش بایگانی</div>
|
||||
<div class="monthly-table__head-cell tw-w-[18%] tw-text-start">نام کارگاه</div>
|
||||
<div class="monthly-table__head-cell tw-w-[14%] tw-text-start">نام کارفرما</div>
|
||||
<div class="monthly-table__head-cell tw-w-[7%] tw-text-center">استان</div>
|
||||
<div class="monthly-table__head-cell tw-w-[7%] tw-text-center">شهرستان</div>
|
||||
<div class="monthly-table__head-cell tw-w-[35%] tw-text-start">جزئیات نشانی </div>
|
||||
<div class="monthly-table__head-cell tw-w-[10%] tw-text-center">وضعیت</div>
|
||||
</div>
|
||||
<div class="monthly-table__body tw-whitespace-nowrap" id="load-data-html-stepAll">
|
||||
|
||||
<div class="monthly-table__body tw-whitespace-nowrap" id="load-data-html-stepAll">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@* //--------- Mobile --------- *@
|
||||
@* Monthly Table Mobile *@
|
||||
<div class="monthly-card-mobile tw-block md:tw-hidden " id="overviewSteps-mobile">
|
||||
<div class="monthly-table monthly-table--striped">
|
||||
<div class="monthly-table__head tw-font-[500] tw-mb-[3px] tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-bg-[#3B73D0] tw-px-2 tw-text-white tw-text-[8px] md:tw-font-[600] md:tw-text-[14px]">
|
||||
<div class="monthly-table__head tw-font-[500] tw-mb-[3px] tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-rounded-[5px] tw-bg-[linear-gradient(180deg,_#41D1D1_0%,_#2CD0D0_100%)] tw-px-2 tw-text-white tw-text-[8px] md:tw-font-[600] md:tw-text-[14px]">
|
||||
<div class="monthly-table__head-cell tw-w-[5%] tw-text tw-text-center">ردیف</div>
|
||||
<div class="monthly-table__head-cell tw-w-[20%] tw-text-center">ش بایگانی</div>
|
||||
<div class="monthly-table__head-cell tw-w-[25%] tw-text-center">نام کارگاه</div>
|
||||
<div class="monthly-table__head-cell tw-w-[25%] tw-text-right">نام کارگاه</div>
|
||||
<div class="monthly-table__head-cell tw-w-[40%] tw-text-center">شماره تماس نماینده</div>
|
||||
<div class="monthly-table__head-cell tw-w-[10%] tw-text-end">عملیات</div>
|
||||
</div>
|
||||
@* <div class="monthly-table__head tw-font-[500] tw-mb-[3px] tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-bg-[linear-gradient(180deg,_#41D1D1_0%,_#2CD0D0_100%)] tw-px-2 tw-text-white tw-text-[8px] md:tw-font-[600] md:tw-text-[13px]">
|
||||
<div class="monthly-table__head-cell tw-w-[10%] tw-text-right ">ردیف</div>
|
||||
<div class="monthly-table__head-cell tw-w-[20%] tw-text-center">نام کارگاه</div>
|
||||
<div class="monthly-table__head-cell tw-w-[70%] tw-text-end">عملیات</div>
|
||||
</div> *@
|
||||
|
||||
<div class="monthly-table__body tw-whitespace-nowrap" id="load-data-html-step0-mobile">
|
||||
</div>
|
||||
@@ -244,7 +303,7 @@
|
||||
@* The whole workshop Mobile *@
|
||||
<div class="monthly-card-mobile tw-block md:tw-hidden" id="overviewAll-mobile" style="display: none">
|
||||
<div class="monthly-table monthly-table--striped ">
|
||||
<div class="monthly-table__head tw-font-[500] tw-mb-[3px] tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-bg-[#3B73D0] tw-px-2 tw-text-white tw-text-[8px] md:tw-font-[600] md:tw-text-[14px]">
|
||||
<div class="monthly-table__head tw-font-[500] tw-mb-[3px] tw-flex tw-h-[35px] tw-items-center tw-whitespace-nowrap tw-rounded-[5px] tw-rounded-[5px] tw-bg-[linear-gradient(180deg,_#41D1D1_0%,_#2CD0D0_100%)] tw-px-2 tw-text-white tw-text-[8px] md:tw-font-[600] md:tw-text-[14px]">
|
||||
<div class="monthly-table__head-cell tw-w-[10%] tw-text tw-text-right">ردیف</div>
|
||||
<div class="monthly-table__head-cell tw-w-[20%] tw-text-right">نام کارگاه</div>
|
||||
|
||||
@@ -259,6 +318,78 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Modal From Bottom For Advance Search -->
|
||||
<div class="modal fade" id="searchModal" tabindex="-1" data-bs-backdrop="static" aria-labelledby="searchModalModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-fullscreen">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header d-block text-center pb-0">
|
||||
<div class="iphone-line mx-auto mb-3"></div>
|
||||
<h5 class="modal-title mb-4 text-start" id="searchModalLabel">جستجوی پیشرفته</h5>
|
||||
</div>
|
||||
|
||||
<div class="modal-body pt-0 mb-3">
|
||||
<div class="container-fluid search-box">
|
||||
|
||||
<div id="overlaySearchAdvance" class=""></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="tw-grid tw-grid-cols-2 md:tw-grid-cols-12 gap-2">
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select EmployerSelect2OptionMobile" aria-label="انتخاب کارفرما" id="employer-select-mobile" name="employerName">
|
||||
<option value="0">انتخاب کارفرما</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select WorkshopSelect2OptionMobile" aria-label="نام کارگاه /شماره بایگانی ..." id="workshop-select-mobile" data-selected-name="نام کارگاه /شماره بایگانی ...">
|
||||
<option value="0"> نام کارگاه /شماره بایگانی </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-col-span-1 md:tw-col-span-2">
|
||||
<select class="form-select AdminPersonnelNameSelect2OptionMobile" aria-label="انتخاب اعضاء" id="admin-personnel-select-mobile" name="adminpersonnelName">
|
||||
<option value=""> انتخاب اعضاء </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="">
|
||||
<select class="form-select" id="status-select-mobile" name="status">
|
||||
<option value="2" selected="selected">فعال/غیر فعال</option>
|
||||
<option value="1">فعال</option>
|
||||
<option value="0">غیر فعال</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<a href="/AdminNew/Company/MonthlyOverview" class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
|
||||
<span class="w-100">حذف جستجو</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer justify-content-center align-items-center">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel w-100" data-bs-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="submit" class="btn-search btn-search-click-mobile w-100">جستجو</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Modal From Bottom For Advance Search -->
|
||||
@section Script {
|
||||
<script src="~/assetsclient/js/site.js?ver=@adminVersion"></script>
|
||||
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
|
||||
@@ -277,6 +408,11 @@
|
||||
var accountSelectListUrl = `@Url.Page("./Index", "AccountSelectList")`;
|
||||
var currentMonth = `@Model.SearchModel.Month`;
|
||||
var adminAccountId = Number(@Model.SearchModel.AdminAccountId);
|
||||
|
||||
var nextPermission = @(hasNextPermission ? "false" : "true");
|
||||
var prevPermission = @(hasPrevPermission ? "false" : "true");
|
||||
|
||||
var accessAccountToSearchAccounts = [2, 3,423,392];
|
||||
</script>
|
||||
<script src="~/AssetsAdminNew/monthlyoverview/js/Index.js?ver=@adminVersion"></script>
|
||||
}
|
||||
@@ -106,6 +106,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.MonthlyOverview
|
||||
public async Task<IActionResult> OnGetAccountSelectList()
|
||||
{
|
||||
var res = await _accountApplication.GetAdminSelectList();
|
||||
//res = res.Where(x => x.RoleId == 5).ToList();
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = res
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user