Compare commits
20 Commits
Feature/cu
...
Feature/au
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a32d1ca9d | |||
| 951a194961 | |||
| 3c0ec01f77 | |||
| 343f830d0d | |||
| 323a46a623 | |||
| 87ff7976fb | |||
| a533850f24 | |||
| b5c1a4c29d | |||
| 28607dec66 | |||
| 4a041ca8e2 | |||
|
|
de0de6fde8 | ||
|
|
70447a74ef | ||
| 90aa6058f0 | |||
| 3df296f205 | |||
| 6a2e4405de | |||
| 88c10ac141 | |||
|
|
8de3939675 | ||
| e78c838cab | |||
|
|
5e4b8a3a80 | ||
|
|
a18984fec1 |
@@ -32,7 +32,7 @@ public static class StaticWorkshopAccounts
|
||||
/// 392 - عمار حسن دوست
|
||||
/// 20 - سمیرا الهی نیا
|
||||
/// </summary>
|
||||
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392, 20];
|
||||
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392, 20, 476];
|
||||
|
||||
/// <summary>
|
||||
/// این تاریخ در جدول اکانت لفت ورک به این معنیست
|
||||
|
||||
@@ -290,4 +290,13 @@ public class PersonalContractingParty : EntityBase
|
||||
this.Gender = gender;
|
||||
this.IsAuthenticated = true;
|
||||
}
|
||||
|
||||
public void EditLegalPartyFromInstitution(string legalPosition, string companyName,
|
||||
string registerId,string nationalId)
|
||||
{
|
||||
LegalPosition = legalPosition;
|
||||
LName = companyName;
|
||||
RegisterId = registerId;
|
||||
NationalId = nationalId;
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ namespace Company.Domain.EmployeeDocumentsAgg
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
EmployeeId = employeeId;
|
||||
Gender = gender;
|
||||
Gender = gender??string.Empty;
|
||||
}
|
||||
|
||||
private EmployeeDocuments()
|
||||
|
||||
@@ -888,6 +888,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
public void RemoveContract(long id)
|
||||
{
|
||||
_institutionContractRepository.RemoveContract(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -981,6 +982,12 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
existingContractingParty.UnAuthenticateLegalEdit(legalCommand.FName,legalCommand.LName,legalCommand.FatherName,legalCommand.IdNumber,existingContractingParty.IdNumberSeri,existingContractingParty.IdNumberSerial,
|
||||
legalCommand.BirthDateFa,legalCommand.Gender,legalCommand.PhoneNumber);
|
||||
}
|
||||
|
||||
if (existingContractingParty != null)
|
||||
{
|
||||
existingContractingParty.EditLegalPartyFromInstitution(command.LegalParty.Position,command.LegalParty.CompanyName,
|
||||
command.LegalParty.RegisterId,command.LegalParty.NationalId);
|
||||
}
|
||||
}
|
||||
else if (command.ContractingPartyLegalType == LegalType.Real)
|
||||
{
|
||||
|
||||
@@ -290,8 +290,34 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
||||
|
||||
|
||||
//get rollCallEmployee associated with those leftworks which have a higher end date than leftworkDate
|
||||
|
||||
var rollCallsEmployee = _rollCallEmployeeRepository.GetBy(employeeId, workshopId);
|
||||
|
||||
if (rollCallsEmployee != null)
|
||||
{
|
||||
var status = rollCallsEmployee.EmployeesStatus.OrderByDescending(z => z.StartDate)
|
||||
.FirstOrDefault(rollCallEmployeeStatus => rollCallEmployeeStatus.StartDate.Date < maxLeftWork.LeftWorkDateGr
|
||||
&& rollCallEmployeeStatus.EndDate.Date >
|
||||
maxLeftWork.LeftWorkDateGr);
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
var adjust = new AdjustRollCallEmployeesWithEmployeeLeftWork()
|
||||
{
|
||||
LeaveDate = maxLeftWork.LeftWorkDateGr,
|
||||
RollCallStatusId = status.id
|
||||
};
|
||||
_rollCallEmployeeStatusRepository.AdjustRollCallStatusEndDates([adjust]);
|
||||
}
|
||||
|
||||
var rollCallEmployeeStatusList = rollCallsEmployee.EmployeesStatus
|
||||
.Where(x => x.StartDate >= maxLeftWork.LeftWorkDateGr).ToList();
|
||||
if (rollCallEmployeeStatusList.Any())
|
||||
{
|
||||
_rollCallEmployeeStatusRepository.RemoveRange(rollCallEmployeeStatusList);
|
||||
_rollCallEmployeeStatusRepository.SaveChanges();
|
||||
}
|
||||
}
|
||||
// var joinedList = rollCallsEmployee.Join(leftWorks, x => x.WorkshopId, y => y.WorkshopId, (x, y) => new
|
||||
// {
|
||||
// x.WorkshopId,
|
||||
@@ -301,27 +327,6 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
||||
// });
|
||||
|
||||
|
||||
var status = rollCallsEmployee.EmployeesStatus.OrderByDescending(z => z.StartDate)
|
||||
.FirstOrDefault(rollCallEmployeeStatus => rollCallEmployeeStatus.StartDate.Date < maxLeftWork.LeftWorkDateGr
|
||||
&& rollCallEmployeeStatus.EndDate.Date >
|
||||
maxLeftWork.LeftWorkDateGr);
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
var adjust = new AdjustRollCallEmployeesWithEmployeeLeftWork()
|
||||
{
|
||||
LeaveDate = maxLeftWork.LeftWorkDateGr,
|
||||
RollCallStatusId = status.id
|
||||
};
|
||||
_rollCallEmployeeStatusRepository.AdjustRollCallStatusEndDates([adjust]);
|
||||
}
|
||||
|
||||
var rollCallEmployeeStatusList = rollCallsEmployee.EmployeesStatus
|
||||
.Where(x => x.StartDate >= maxLeftWork.LeftWorkDateGr).ToList();
|
||||
if (rollCallEmployeeStatusList.Any())
|
||||
{
|
||||
_rollCallEmployeeStatusRepository.RemoveRange(rollCallEmployeeStatusList);
|
||||
_rollCallEmployeeStatusRepository.SaveChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -446,7 +446,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد");
|
||||
}
|
||||
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr)))
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate.Value.Date >= y.StartDateGr.Date && x.EndDate.Value.Date <= y.EndDateGr.Date)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
|
||||
|
||||
@@ -486,7 +486,8 @@ public class RollCallApplication : IRollCallApplication
|
||||
|
||||
|
||||
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr)))
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate.Value.Date >= y.StartDateGr.Date
|
||||
&& x.EndDate.Value.Date <= y.EndDateGr.Date)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
|
||||
|
||||
@@ -630,7 +631,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد");
|
||||
}
|
||||
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr)))
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate.Value.Date >= y.StartDateGr.Date && x.EndDate.Value.Date <= y.EndDateGr.Date)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
|
||||
|
||||
@@ -662,7 +663,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
&& (y.StartDate.Value.Date <= x.ContractEndGr.Date))))
|
||||
return operation.Failed("برای بازه های وارد شده فیش حقوقی ثبت شده است");
|
||||
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr)))
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate.Value.Date >= y.StartDateGr.Date && x.EndDate.Value.Date <= y.EndDateGr.Date)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
|
||||
var currentDayRollCall = employeeRollCalls.FirstOrDefault(x => x.EndDate == null);
|
||||
|
||||
@@ -240,6 +240,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
result.IdNumberSerial = createTemp.IdNumberSerial;
|
||||
result.IdNumber = idNumber;
|
||||
result.NationalCode = createTemp.NationalCode;
|
||||
result.Phone = createTemp.Phone;
|
||||
result.IdNumberSeri = createTemp.IdNumberSeri;
|
||||
|
||||
|
||||
return op.Succcedded(result);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -507,10 +507,24 @@
|
||||
</svg>
|
||||
لیست تراکنش های درگاه پرداخت
|
||||
</a></li>
|
||||
<li permission="307" style=";white-space: nowrap">
|
||||
<a class="clik10 " href="https://admin@(AppSetting.Value.Domain)/account-number-database" style="width: 7px;margin: 0 6px;">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
اطلاعات بانکی طرف حساب
|
||||
</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a asp-area="AdminNew" asp-page="/Index" asp-page-handler="ProgramManager" class="waves-effect btnCustom">
|
||||
<div class="menuTitle">
|
||||
<i class="md md-home"></i>
|
||||
<span> پروگرام منیجر </span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
@@ -7,6 +7,10 @@ using Company.Domain.WorkshopAccountAgg;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
namespace ServiceHost.Areas.AdminNew.Pages
|
||||
@@ -121,5 +125,51 @@ namespace ServiceHost.Areas.AdminNew.Pages
|
||||
data = checkerCount,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetProgramManager()
|
||||
{
|
||||
try
|
||||
{
|
||||
// دریافت اطلاعات کاربر فعلی
|
||||
var currentAccountId = _authHelper.CurrentAccountId();
|
||||
var accountInfo = _authHelper.CurrentAccountInfo();
|
||||
|
||||
// تعریف Secret Key برای JWT (باید در appsettings.json تعریف شود)
|
||||
var secretKey = _configuration["JwtSettings:SecretKey"] ?? ">3£>^1UBG@yw)QdhRC3$£:;r8~?qpp^oKK4D3a~8L2>enF;lkgh";
|
||||
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secretKey));
|
||||
var credentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
|
||||
|
||||
// ایجاد Claims
|
||||
var claims = new[]
|
||||
{
|
||||
new Claim(ClaimTypes.NameIdentifier, currentAccountId.ToString()),
|
||||
new Claim(ClaimTypes.Name, accountInfo.Fullname ?? ""),
|
||||
new Claim(ClaimTypes.Email, accountInfo.Username ?? ""),
|
||||
new Claim("AccountId", currentAccountId.ToString()),
|
||||
new Claim("RoleId", accountInfo.RoleId.ToString())
|
||||
};
|
||||
|
||||
// ایجاد JWT Token
|
||||
var token = new JwtSecurityToken(
|
||||
issuer: _configuration["JwtSettings:Issuer"] ?? "GozareshgirApp",
|
||||
audience: _configuration["JwtSettings:Audience"] ?? "GozareshgirUsers",
|
||||
claims: claims,
|
||||
expires: DateTime.UtcNow.AddMinutes(int.Parse(_configuration["JwtSettings:ExpirationMinutes"] ?? "30")),
|
||||
signingCredentials: credentials
|
||||
);
|
||||
|
||||
var tokenString = new JwtSecurityTokenHandler().WriteToken(token);
|
||||
var domain = _configuration["GozareshgirProgramManager:Domain"] ?? "http://localhost:5000";
|
||||
// Redirect به SSO-Login با Token
|
||||
var ssoUrl = $"https://pm{domain}/ssologin?token={Uri.EscapeDataString(tokenString)}";
|
||||
// var ssoUrl = $"https://localhost:7032/api/Auth/sso-login?token={Uri.EscapeDataString(tokenString)}";
|
||||
return Redirect(ssoUrl);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// در صورت خطا، برگشت به صفحه اصلی
|
||||
return RedirectToPage("/Index");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -655,9 +655,22 @@
|
||||
</svg>
|
||||
لیست تراکنش های درگاه پرداخت
|
||||
</a></li>
|
||||
<li permission="307" style=";white-space: nowrap">
|
||||
<a class="clik10 " href="https://admin@(AppSetting.Value.Domain)/account-number-database" style="width: 7px;margin: 0 6px;">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
اطلاعات بانکی طرف حساب
|
||||
</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a asp-area="AdminNew" asp-page="/Index" asp-page-handler="ProgramManager" class="waves-effect btnCustom">
|
||||
<div class="menuTitle">
|
||||
<i class="md md-home"></i>
|
||||
<span> پروگرام منیجر </span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"sqlDebugging": true,
|
||||
"dotnetRunMessages": "true",
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "https://localhost:5004;http://localhost:5003;https://192.168.0.117:5005",
|
||||
"applicationUrl": "https://localhost:5004;http://localhost:5003;",
|
||||
"jsWebView2Debugging": false,
|
||||
"hotReloadEnabled": true
|
||||
},
|
||||
|
||||
@@ -48,7 +48,13 @@
|
||||
//, "09116067106", "09114221321"
|
||||
]
|
||||
},
|
||||
"SepehrGateWayTerminalId": 99213700
|
||||
"SepehrGateWayTerminalId": 99213700,
|
||||
"JwtSettings": {
|
||||
"SecretKey": ">3£>^1UBG@yw)QdhRC3$£:;r8~?qpp^oKK4D3a~8L2>enF;lkgh",
|
||||
"Issuer": "GozareshgirApp",
|
||||
"Audience": "GozareshgirUsers",
|
||||
"ExpirationMinutes": 30
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
//"MesbahDb": "Data Source=.\\MSSQLSERVER2019;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=mesbah_db;Password=sa142857$@;"
|
||||
//"MesbahDb": "Data Source=.\\MSSQLSERVER2019;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=mesbah_db;Password=sa142857$@;"
|
||||
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
|
||||
|
||||
//dad-mehr
|
||||
@@ -36,6 +36,11 @@
|
||||
"IsTestMode": false,
|
||||
"TestNumbers": []
|
||||
},
|
||||
"SepehrGateWayTerminalId": 99213700
|
||||
|
||||
"SepehrGateWayTerminalId": 99213700,
|
||||
"JwtSettings": {
|
||||
"SecretKey": ">3£>^1UBG@yw)QdhRC3$£:;r8~?qpp^oKK4D3a~8L2>enF;lkgh",
|
||||
"Issuer": "GozareshgirApp",
|
||||
"Audience": "GozareshgirUsers",
|
||||
"ExpirationMinutes": 30
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user