Compare commits

...

20 Commits

Author SHA1 Message Date
3a32d1ca9d Merge branch 'master' into Feature/authorize/program-manager 2025-12-07 18:22:56 +03:30
951a194961 Add Program Manager menu item and update SSO login URL 2025-12-07 18:22:44 +03:30
3c0ec01f77 Fix date comparison logic in roll call validation 2025-12-06 18:57:52 +03:30
343f830d0d Fix calculation of discounted payment amount in institution contract repository 2025-12-06 16:46:02 +03:30
323a46a623 Add Program Manager menu item and implement JWT token generation for SSO login 2025-12-06 16:24:11 +03:30
87ff7976fb Add menu item for bank account information
Added a new menu item with `permission="307"` to `_Menu.cshtml`
for accessing the `account-number-database` page. The link
is dynamically constructed using `AppSetting.Value.Domain`
and styled with `class="clik10"` and inline styles. Included
an SVG icon and the text "اطلاعات بانکی طرف حساب"
("Bank account information of the counterparty"). Maintained
the hierarchical structure of the menu.
2025-12-06 10:41:03 +03:30
a533850f24 Enhance contract removal logic and handle financial statement updates 2025-12-04 10:36:59 +03:30
b5c1a4c29d Refactor legal party handling logic
Replaced `realPersonalContractingParty` with `legalPersonalContractingParty` to ensure correct variable usage in legal party operations. Updated the authentication logic to handle both authenticated and unauthenticated states, introducing a new `else` block for `LegalAuthentication`. Adjusted method calls (`UnAuthenticateLegalEdit` and `EditLegalPartyFromInstitution`) to use the updated variable and ensure consistent updates to legal party details.
2025-12-03 20:21:08 +03:30
28607dec66 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-12-03 12:10:52 +03:30
4a041ca8e2 add condition for null rollcall employee in IfEmloyeeHasNewLeftWorkDateAddEndDateToRollCallStatus 2025-12-03 12:10:48 +03:30
SamSys
de0de6fde8 Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir 2025-12-02 15:01:41 +03:30
SamSys
70447a74ef change lunchSettings 2025-12-02 15:01:25 +03:30
90aa6058f0 Handle "*" in NationalCode assignment gracefully
Updated the `NationalCode` assignment in the `CreateInstitutionContractLegalPartyRequest` object to replace `"*"` with an empty string (`string.Empty`). This ensures compliance with business rules where `"*"` is not considered a valid value for `NationalCode`. Retains the original value otherwise.
2025-12-02 14:40:54 +03:30
3df296f205 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-12-02 14:23:39 +03:30
6a2e4405de add check for gender if is empty 2025-12-02 14:00:01 +03:30
88c10ac141 Add phone and ID number series fields to temporary client registration result 2025-12-02 13:44:25 +03:30
SamSys
8de3939675 change lunch setting adddress 2025-12-02 13:06:22 +03:30
e78c838cab Add method to edit legal party details from institution in contracting party 2025-12-02 13:00:34 +03:30
SamSys
5e4b8a3a80 change static file permiission 2025-12-02 11:51:13 +03:30
SamSys
a18984fec1 add account to static list 2025-12-02 11:37:29 +03:30
14 changed files with 602 additions and 424 deletions

View File

@@ -32,7 +32,7 @@ public static class StaticWorkshopAccounts
/// 392 - عمار حسن دوست /// 392 - عمار حسن دوست
/// 20 - سمیرا الهی نیا /// 20 - سمیرا الهی نیا
/// </summary> /// </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> /// <summary>
/// این تاریخ در جدول اکانت لفت ورک به این معنیست /// این تاریخ در جدول اکانت لفت ورک به این معنیست

View File

@@ -290,4 +290,13 @@ public class PersonalContractingParty : EntityBase
this.Gender = gender; this.Gender = gender;
this.IsAuthenticated = true; this.IsAuthenticated = true;
} }
public void EditLegalPartyFromInstitution(string legalPosition, string companyName,
string registerId,string nationalId)
{
LegalPosition = legalPosition;
LName = companyName;
RegisterId = registerId;
NationalId = nationalId;
}
} }

View File

@@ -37,7 +37,7 @@ namespace Company.Domain.EmployeeDocumentsAgg
{ {
WorkshopId = workshopId; WorkshopId = workshopId;
EmployeeId = employeeId; EmployeeId = employeeId;
Gender = gender; Gender = gender??string.Empty;
} }
private EmployeeDocuments() private EmployeeDocuments()

View File

@@ -888,6 +888,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
public void RemoveContract(long id) public void RemoveContract(long id)
{ {
_institutionContractRepository.RemoveContract(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, existingContractingParty.UnAuthenticateLegalEdit(legalCommand.FName,legalCommand.LName,legalCommand.FatherName,legalCommand.IdNumber,existingContractingParty.IdNumberSeri,existingContractingParty.IdNumberSerial,
legalCommand.BirthDateFa,legalCommand.Gender,legalCommand.PhoneNumber); 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) else if (command.ContractingPartyLegalType == LegalType.Real)
{ {

View File

@@ -290,8 +290,34 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
//get rollCallEmployee associated with those leftworks which have a higher end date than leftworkDate //get rollCallEmployee associated with those leftworks which have a higher end date than leftworkDate
var rollCallsEmployee = _rollCallEmployeeRepository.GetBy(employeeId, workshopId); 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 // var joinedList = rollCallsEmployee.Join(leftWorks, x => x.WorkshopId, y => y.WorkshopId, (x, y) => new
// { // {
// x.WorkshopId, // 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();
}
} }
} }

View File

@@ -446,7 +446,7 @@ public class RollCallApplication : IRollCallApplication
return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد"); 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("کارمند در بازه وارد شده غیر فعال است"); 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("کارمند در بازه وارد شده غیر فعال است"); return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
@@ -630,7 +631,7 @@ public class RollCallApplication : IRollCallApplication
return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد"); 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("کارمند در بازه وارد شده غیر فعال است"); return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
@@ -662,7 +663,7 @@ public class RollCallApplication : IRollCallApplication
&& (y.StartDate.Value.Date <= x.ContractEndGr.Date)))) && (y.StartDate.Value.Date <= x.ContractEndGr.Date))))
return operation.Failed("برای بازه های وارد شده فیش حقوقی ثبت شده است"); 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("کارمند در بازه وارد شده غیر فعال است"); return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
var currentDayRollCall = employeeRollCalls.FirstOrDefault(x => x.EndDate == null); var currentDayRollCall = employeeRollCalls.FirstOrDefault(x => x.EndDate == null);

View File

@@ -240,6 +240,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
result.IdNumberSerial = createTemp.IdNumberSerial; result.IdNumberSerial = createTemp.IdNumberSerial;
result.IdNumber = idNumber; result.IdNumber = idNumber;
result.NationalCode = createTemp.NationalCode; result.NationalCode = createTemp.NationalCode;
result.Phone = createTemp.Phone;
result.IdNumberSeri = createTemp.IdNumberSeri;
return op.Succcedded(result); return op.Succcedded(result);

View File

@@ -507,10 +507,24 @@
</svg> </svg>
لیست تراکنش های درگاه پرداخت لیست تراکنش های درگاه پرداخت
</a></li> </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> </ul>
</li> </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> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>

View File

@@ -7,6 +7,10 @@ using Company.Domain.WorkshopAccountAgg;
using CompanyManagment.App.Contracts.Workshop; using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; 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; using WorkFlow.Application.Contracts.AdminWorkFlow;
namespace ServiceHost.Areas.AdminNew.Pages namespace ServiceHost.Areas.AdminNew.Pages
@@ -121,5 +125,51 @@ namespace ServiceHost.Areas.AdminNew.Pages
data = checkerCount, 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");
}
}
} }
} }

View File

@@ -655,9 +655,22 @@
</svg> </svg>
لیست تراکنش های درگاه پرداخت لیست تراکنش های درگاه پرداخت
</a></li> </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> </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> </li>
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>

View File

@@ -19,7 +19,7 @@
"sqlDebugging": true, "sqlDebugging": true,
"dotnetRunMessages": "true", "dotnetRunMessages": "true",
"nativeDebugging": 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, "jsWebView2Debugging": false,
"hotReloadEnabled": true "hotReloadEnabled": true
}, },

View File

@@ -48,7 +48,13 @@
//, "09116067106", "09114221321" //, "09116067106", "09114221321"
] ]
}, },
"SepehrGateWayTerminalId": 99213700 "SepehrGateWayTerminalId": 99213700,
"JwtSettings": {
"SecretKey": ">3£>^1UBG@yw)QdhRC3$£:;r8~?qpp^oKK4D3a~8L2>enF;lkgh",
"Issuer": "GozareshgirApp",
"Audience": "GozareshgirUsers",
"ExpirationMinutes": 30
}
} }

View File

@@ -7,7 +7,7 @@
} }
}, },
"ConnectionStrings": { "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;", "MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
//dad-mehr //dad-mehr
@@ -36,6 +36,11 @@
"IsTestMode": false, "IsTestMode": false,
"TestNumbers": [] "TestNumbers": []
}, },
"SepehrGateWayTerminalId": 99213700 "SepehrGateWayTerminalId": 99213700,
"JwtSettings": {
"SecretKey": ">3£>^1UBG@yw)QdhRC3$£:;r8~?qpp^oKK4D3a~8L2>enF;lkgh",
"Issuer": "GozareshgirApp",
"Audience": "GozareshgirUsers",
"ExpirationMinutes": 30
}
} }