Compare commits
18 Commits
Feature/pr
...
Feature/in
| Author | SHA1 | Date | |
|---|---|---|---|
| 56e79d2099 | |||
| 93891f3837 | |||
|
|
5bdfbc572b | ||
|
|
07113353c4 | ||
| 8c6336b9bd | |||
| 20e3d454cf | |||
| 2bf31db6b2 | |||
| 7a4a6de84f | |||
| 4f16d7680c | |||
|
|
7a10d5ce59 | ||
|
|
3d88feeee7 | ||
|
|
f408624463 | ||
|
|
8296292e49 | ||
| be8deef167 | |||
| 84fb29c8c8 | |||
| 0969e8a5fd | |||
| 92e2282381 | |||
|
|
3b71b7d707 |
@@ -17,7 +17,7 @@ public class ExcelGenerator
|
||||
{
|
||||
public ExcelGenerator()
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
}
|
||||
public static byte[] GenerateExcel<T>(List<T> obj, string date = "") where T : class
|
||||
{
|
||||
|
||||
@@ -155,6 +155,8 @@ public class AccountApplication : IAccountApplication
|
||||
|
||||
if (command.IsProgramManagerUser)
|
||||
{
|
||||
if (command.UserRoles == null)
|
||||
return operation.Failed("حداقل یک نقش برای کاربر مدیریت پروژه لازم است");
|
||||
var pmUserRoles = command.UserRoles.Where(x => x > 0).ToList();
|
||||
var createPm = await _pmUserCommandService.Create(new CreatePmUserDto(command.Fullname, command.Username, account.Password, command.Mobile,
|
||||
null, account.id, pmUserRoles));
|
||||
@@ -252,6 +254,8 @@ public class AccountApplication : IAccountApplication
|
||||
//);
|
||||
var userResult =await _pmUserQueryService.GetPmUserDataByAccountId(account.id);
|
||||
|
||||
if (command.UserRoles == null)
|
||||
return operation.Failed("حداقل یک نقش برای کاربر مدیریت پروژه لازم است");
|
||||
var pmUserRoles = command.UserRoles.Where(x => x > 0).ToList();
|
||||
|
||||
//اگر کاربر در پروگرام منیجر قبلا ایجاد شده
|
||||
@@ -396,6 +400,23 @@ public class AccountApplication : IAccountApplication
|
||||
.Permissions
|
||||
.Select(x => x.Code)
|
||||
.ToList();
|
||||
//PmPermission
|
||||
var PmUserData = _pmUserQueryService.GetPmUserDataByAccountId(account.id).GetAwaiter().GetResult();
|
||||
if (PmUserData.AccountId > 0 && PmUserData.IsActive)
|
||||
{
|
||||
|
||||
var pmUserPermissions =
|
||||
PmUserData.RoleListDto != null
|
||||
? PmUserData.RoleListDto
|
||||
.SelectMany(x => x.Permissions)
|
||||
.Where(p => p != 99)
|
||||
.Distinct()
|
||||
.ToList()
|
||||
: new List<int>();
|
||||
permissions.AddRange(pmUserPermissions);
|
||||
}
|
||||
|
||||
|
||||
int? positionValue;
|
||||
if (account.PositionId != null)
|
||||
{
|
||||
@@ -405,7 +426,7 @@ public class AccountApplication : IAccountApplication
|
||||
{
|
||||
positionValue = null;
|
||||
}
|
||||
var pmUserId = _pmUserQueryService.GetCurrentPmUserIdFromAccountId(account.id).GetAwaiter().GetResult();
|
||||
var pmUserId = PmUserData.AccountId > 0 ? PmUserData.AccountId : null;
|
||||
var authViewModel = new AuthViewModel(account.id, account.RoleId, account.Fullname
|
||||
, account.Username, account.Mobile, account.ProfilePhoto,
|
||||
permissions, account.RoleName, account.AdminAreaPermission,
|
||||
|
||||
@@ -98,6 +98,11 @@ public class InstitutionContract : EntityBase
|
||||
// مبلغ قرارداد
|
||||
public double ContractAmount { get; private set; }
|
||||
|
||||
public double ContractAmountWithTax => !IsOldContract ? ContractAmount + ContractAmountTax
|
||||
: ContractAmount;
|
||||
|
||||
public double ContractAmountTax => ContractAmount*0.10;
|
||||
|
||||
//خسارت روزانه
|
||||
public double DailyCompenseation { get; private set; }
|
||||
|
||||
@@ -159,6 +164,8 @@ public class InstitutionContract : EntityBase
|
||||
|
||||
public List<InstitutionContractAmendment> Amendments { get; private set; }
|
||||
|
||||
public bool IsOldContract => LawId== 0;
|
||||
|
||||
public InstitutionContract()
|
||||
{
|
||||
ContactInfoList = [];
|
||||
|
||||
@@ -73,6 +73,7 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
|
||||
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
|
||||
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
Task<PagedResult<InsuranceClientListViewModel>> GetInsuranceClientList(InsuranceClientSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -316,7 +316,10 @@ public class Workshop : EntityBase
|
||||
IsStaticCheckout = isStaticCheckout;
|
||||
}
|
||||
|
||||
|
||||
public void AddContractingPartyId(long contractingPartyId)
|
||||
{
|
||||
ContractingPartyId = contractingPartyId;
|
||||
}
|
||||
public void Active(string archiveCode)
|
||||
{
|
||||
this.IsActive = true;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CustomizeWorkshopGroupSettingExcelGenerator
|
||||
{
|
||||
public static byte[] Generate(List<CustomizeWorkshopGroupExcelViewModel> groups)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using (var package = new ExcelPackage())
|
||||
{
|
||||
var worksheet = package.Workbook.Worksheets.Add("GroupsAndEmployees");
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CaseManagementExcelGenerator
|
||||
};
|
||||
public static byte[] GenerateCheckoutTempExcelInfo(List<FileExcelViewModel> data)
|
||||
{
|
||||
OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using var package = new ExcelPackage();
|
||||
CreateSheet(data, package,"همه");
|
||||
CreateSheet(data.Where(x=>x.Status ==2).ToList(), package,"فعال");
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CustomizeCheckoutExcelGenerator
|
||||
};
|
||||
public static byte[] GenerateCheckoutTempExcelInfo(List<CustomizeCheckoutTempExcelViewModel> data, List<string> selectedParameters)
|
||||
{
|
||||
OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using var package = new ExcelPackage();
|
||||
var worksheet = package.Workbook.Worksheets.Add("Sheet1");
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ public class EmployeeBankInfoExcelGenerator
|
||||
{
|
||||
public static byte[] Generate(List<EmployeeBankInfoExcelViewModel> list)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using var package = new ExcelPackage();
|
||||
var worksheet = package.Workbook.Worksheets.Add("EmployeeBankInfo");
|
||||
|
||||
@@ -166,7 +166,7 @@ public class EmployeeBankInfoExcelGenerator
|
||||
|
||||
public static byte[] Generate2(List<EmployeeBankInfoExcelViewModel> list)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using var package = new ExcelPackage();
|
||||
foreach (var employee in list)
|
||||
{
|
||||
@@ -220,4 +220,4 @@ public class EmployeeBankInfoExcelGenerator
|
||||
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class InstitutionContractExcelGenerator
|
||||
|
||||
public static byte[] GenerateExcel(List<InstitutionContractViewModel> institutionContractViewModels)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using var package = new ExcelPackage();
|
||||
var allWorksheet = package.Workbook.Worksheets.Add("همه");
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ public class RollCallExcelGenerator : ExcelGenerator
|
||||
{
|
||||
public static byte[] CaseHistoryExcelForEmployee(CaseHistoryRollCallExcelForEmployeeViewModel data)
|
||||
{
|
||||
OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using var package = new OfficeOpenXml.ExcelPackage();
|
||||
var worksheet = package.Workbook.Worksheets.Add("Sheet1");
|
||||
var rollCalls = data.RollCalls;
|
||||
@@ -181,7 +181,7 @@ public class RollCallExcelGenerator : ExcelGenerator
|
||||
|
||||
public static byte[] CaseHistoryExcelForOneDay(CaseHistoryRollCallForOneDayViewModel data)
|
||||
{
|
||||
OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
OfficeOpenXml.ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using var package = new OfficeOpenXml.ExcelPackage();
|
||||
var worksheet = package.Workbook.Worksheets.Add("Sheet1");
|
||||
var rollCalls = data.RollCalls;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SalaryAidImportExcel
|
||||
ValidData = []
|
||||
};
|
||||
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
|
||||
if (file == null || file.Length == 0)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ public class WorkshopRollCallExcelExporter
|
||||
{
|
||||
public static byte[] Export(List<WorkshopRollCallExcelViewModel> workshops)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
ExcelPackage.License.SetNonCommercialOrganization("Gozareshgir Noncommercial organization");
|
||||
using (var package = new ExcelPackage())
|
||||
{
|
||||
var ws = package.Workbook.Worksheets.Add("Workshops");
|
||||
|
||||
@@ -60,7 +60,7 @@ public interface IEmployeeApplication
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<EmployeeByNationalCodeInWorkshopViewModel>>
|
||||
ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(string nationalCode,
|
||||
string birthDate, long workshopId);
|
||||
string birthDate,bool authorizedCanceled, long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// پرسنل هایی که در کارگاهی از سمت ادمین شروع به کار کرده اند
|
||||
|
||||
@@ -344,6 +344,9 @@ public class InstitutionContractPrintViewModel
|
||||
public string TotalPrice { get; set; }
|
||||
public string TaxPrice { get; set; }
|
||||
public string PaymentPrice { get; set; }
|
||||
public string OneMonthPrice { get; set; }
|
||||
public string OneMonthWithoutTax { get; set; }
|
||||
public string OneMonthTax { get; set; }
|
||||
public string VerifyCode { get; set; }
|
||||
public string VerifyDate { get; set; }
|
||||
public string VerifyTime { get; set; }
|
||||
|
||||
@@ -90,8 +90,27 @@ public interface IInsuranceListApplication
|
||||
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
|
||||
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
Task<PagedResult<InsuranceClientListViewModel>> GetInsuranceClientList(InsuranceClientSearchModel searchModel);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
Task<List<InsuranceListViewModel>> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel);
|
||||
}
|
||||
|
||||
public class InsuranceClientSearchModel:PaginationRequest
|
||||
{
|
||||
public int Year { get; set; }
|
||||
public int Month { get; set; }
|
||||
public string Sorting { get; set; }
|
||||
}
|
||||
public class InsuranceClientListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Year { get; set; }
|
||||
public string Month { get; set; }
|
||||
public long WorkShopId { get; set; }
|
||||
public int YearInt { get; set; }
|
||||
public string MonthName { get; set; }
|
||||
public int MonthInt { get; set; }
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
System.IO.File.WriteAllBytes(filePath, bytes);
|
||||
}
|
||||
public async Task<OperationResult<EmployeeByNationalCodeInWorkshopViewModel>>
|
||||
ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(string nationalCode, string birthDate, long workshopId)
|
||||
ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(string nationalCode, string birthDate,bool authorizedCanceled, long workshopId)
|
||||
{
|
||||
var op = new OperationResult<EmployeeByNationalCodeInWorkshopViewModel>();
|
||||
|
||||
@@ -1279,65 +1279,25 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
var employee = _EmployeeRepository.GetByNationalCodeIgnoreQueryFilter(nationalCode);
|
||||
|
||||
if (employee == null)
|
||||
if (employee == null && !authorizedCanceled)
|
||||
{
|
||||
var personalInfo = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (personalInfo.ResponseContext.Status.Code == 14)
|
||||
if (personalInfo != null)
|
||||
{
|
||||
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeByNationalCodeInWorkshopViewModel() { AuthorizedCanceled = true });
|
||||
}
|
||||
if (personalInfo.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
if (personalInfo.ResponseContext.Status.Code == 14)
|
||||
{
|
||||
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeByNationalCodeInWorkshopViewModel() { AuthorizedCanceled = true });
|
||||
}
|
||||
if (personalInfo.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
|
||||
var basicInfo = personalInfo.BasicInformation;
|
||||
var identityInfo = personalInfo.IdentificationInformation;
|
||||
DateTime apiBirthDate = identityInfo.BirthDate.ToGeorgianDateTime();
|
||||
var basicInfo = personalInfo.BasicInformation;
|
||||
var identityInfo = personalInfo.IdentificationInformation;
|
||||
DateTime apiBirthDate = identityInfo.BirthDate.ToGeorgianDateTime();
|
||||
|
||||
var dateOfIssue = new DateTime(1922, 1, 1);
|
||||
|
||||
var gender = basicInfo.GenderEnum switch
|
||||
{
|
||||
Gender.Female => "زن",
|
||||
Gender.Male => "مرد",
|
||||
_ => throw new AggregateException()
|
||||
};
|
||||
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
|
||||
var newEmployee = new Employee(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
|
||||
dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی", identityInfo.ShenasnameSerial, identityInfo.ShenasnameSeri);
|
||||
newEmployee.Authorized();
|
||||
await _EmployeeRepository.CreateAsync(newEmployee);
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel()
|
||||
{
|
||||
EmployeeId = newEmployee.id,
|
||||
EmployeeFName = newEmployee.FName,
|
||||
Gender = newEmployee.Gender,
|
||||
Nationality = newEmployee.Nationality,
|
||||
EmployeeLName = newEmployee.LName
|
||||
});
|
||||
}
|
||||
|
||||
if (_leftWorkTempRepository.ExistsIgnoreQueryFilter(x =>
|
||||
x.EmployeeId == employee.id && x.WorkshopId == workshopId && x.LeftWorkType == LeftWorkTempType.StartWork))
|
||||
{
|
||||
return op.Failed("این پرسنل در کارگاه شما قبلا افزوده شده است و در انتظار تایید میباشد");
|
||||
}
|
||||
|
||||
if (employee.IsAuthorized == false)
|
||||
{
|
||||
var personalInfoResponse = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (personalInfoResponse.ResponseContext.Status.Code == 0)
|
||||
{
|
||||
var basicInfo = personalInfoResponse.BasicInformation;
|
||||
var identityInfo = personalInfoResponse.IdentificationInformation;
|
||||
var apiBirthDate = identityInfo.BirthDate.ToGeorgianDateTime();
|
||||
var dateOfIssue = new DateTime(1922, 1, 1);
|
||||
|
||||
var gender = basicInfo.GenderEnum switch
|
||||
{
|
||||
@@ -1348,31 +1308,90 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
|
||||
|
||||
employee.Edit(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
|
||||
employee.DateOfIssue, employee.PlaceOfIssue, identityInfo.NationalId, idNumber,
|
||||
gender, "ایرانی", employee.Phone, employee.Address, employee.State, employee.City,
|
||||
employee.MaritalStatus, employee.MilitaryService, employee.LevelOfEducation,
|
||||
employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode, employee.InsuranceHistoryByYear,
|
||||
employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
|
||||
employee.Authorized();
|
||||
|
||||
var newEmployee = new Employee(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
|
||||
dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی", identityInfo.ShenasnameSerial, identityInfo.ShenasnameSeri);
|
||||
newEmployee.Authorized();
|
||||
await _EmployeeRepository.CreateAsync(newEmployee);
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel()
|
||||
{
|
||||
EmployeeId = newEmployee.id,
|
||||
EmployeeFName = newEmployee.FName,
|
||||
Gender = newEmployee.Gender,
|
||||
Nationality = newEmployee.Nationality,
|
||||
EmployeeLName = newEmployee.LName
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeByNationalCodeInWorkshopViewModel() { AuthorizedCanceled = true });
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if (employee == null && authorizedCanceled)
|
||||
{
|
||||
return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel());
|
||||
}
|
||||
|
||||
if (_leftWorkTempRepository.ExistsIgnoreQueryFilter(x =>
|
||||
x.EmployeeId == employee.id && x.WorkshopId == workshopId && x.LeftWorkType == LeftWorkTempType.StartWork))
|
||||
{
|
||||
return op.Failed("این پرسنل در کارگاه شما قبلا افزوده شده است و در انتظار تایید میباشد");
|
||||
}
|
||||
|
||||
var personalInfoResponse = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
if (personalInfoResponse != null)
|
||||
{
|
||||
if (employee.IsAuthorized == false)
|
||||
{
|
||||
|
||||
|
||||
if (personalInfoResponse.ResponseContext.Status.Code == 0)
|
||||
{
|
||||
var basicInfo = personalInfoResponse.BasicInformation;
|
||||
var identityInfo = personalInfoResponse.IdentificationInformation;
|
||||
var apiBirthDate = identityInfo.BirthDate.ToGeorgianDateTime();
|
||||
|
||||
var gender = basicInfo.GenderEnum switch
|
||||
{
|
||||
Gender.Female => "زن",
|
||||
Gender.Male => "مرد",
|
||||
_ => throw new AggregateException()
|
||||
};
|
||||
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
|
||||
|
||||
employee.Edit(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
|
||||
employee.DateOfIssue, employee.PlaceOfIssue, identityInfo.NationalId, idNumber,
|
||||
gender, "ایرانی", employee.Phone, employee.Address, employee.State, employee.City,
|
||||
employee.MaritalStatus, employee.MilitaryService, employee.LevelOfEducation,
|
||||
employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode, employee.InsuranceHistoryByYear,
|
||||
employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
|
||||
employee.Authorized();
|
||||
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return op.Failed("کد ملی با تاریخ تولد وارد شده مطابقت ندارد");
|
||||
}
|
||||
}
|
||||
else if (employee.DateOfBirth.ToFarsi() != birthDate || employee.NationalCode != nationalCode)
|
||||
{
|
||||
return op.Failed("کد ملی با تاریخ تولد وارد شده مطابقت ندارد");
|
||||
}
|
||||
}
|
||||
else if (employee.DateOfBirth.ToFarsi() != birthDate || employee.NationalCode != nationalCode)
|
||||
{
|
||||
return op.Failed("کد ملی با تاریخ تولد وارد شده مطابقت ندارد");
|
||||
}
|
||||
|
||||
|
||||
var leftWorkViewModel = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(workshopId, employee.id);
|
||||
if (leftWorkViewModel == null)
|
||||
|
||||
@@ -2371,6 +2371,11 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
return _insuranceListRepositpry.GetTabCounts(searchModel);
|
||||
}
|
||||
|
||||
public async Task<PagedResult<InsuranceClientListViewModel>> GetInsuranceClientList(InsuranceClientSearchModel searchModel)
|
||||
{
|
||||
return await _insuranceListRepositpry.GetInsuranceClientList(searchModel);
|
||||
}
|
||||
|
||||
public async Task<List<InsuranceListViewModel>> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
return await _insuranceListRepositpry.GetNotCreatedWorkshop(searchModel);
|
||||
|
||||
@@ -45,5 +45,10 @@ public class InstitutionContractMapping : IEntityTypeConfiguration<InstitutionCo
|
||||
|
||||
builder.HasMany(x => x.Amendments).WithOne(x => x.InstitutionContract)
|
||||
.HasForeignKey(x => x.InstitutionContractId);
|
||||
|
||||
|
||||
builder.Ignore(x => x.ContractAmountWithTax);
|
||||
builder.Ignore(x => x.ContractAmountTax);
|
||||
builder.Ignore(x => x.ContractAmountTax);
|
||||
}
|
||||
}
|
||||
@@ -1375,7 +1375,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
.Count(l => l.StartWorkDate <= DateTime.Now && l.LeftWorkDate >= DateTime.Now);
|
||||
return new GetInstitutionContractListItemsViewModel()
|
||||
{
|
||||
ContractAmount = x.contract.ContractAmount,
|
||||
ContractAmount = x.contract.ContractAmountWithTax,
|
||||
Balance = statement?.FinancialTransactionList.Sum(ft => ft.Deptor - ft.Creditor) ?? 0,
|
||||
WorkshopsCount = workshops.Count(),
|
||||
ContractStartFa = x.contract.ContractStartGr.ToFarsi(),
|
||||
@@ -1395,9 +1395,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
Workshops = workshopDetails,
|
||||
IsInPersonContract = x.contract.WorkshopGroup?.CurrentWorkshops
|
||||
.Any(y => y.Services.ContractInPerson) ?? true,
|
||||
IsOldContract = x.contract.WorkshopGroup?.CurrentWorkshops == null
|
||||
|| x.contract.WorkshopGroup.CurrentWorkshops.Count == 0
|
||||
|| x.contract.WorkshopGroup.CurrentWorkshops.Any(y => y.Price == 0)
|
||||
IsOldContract = x.contract.IsOldContract
|
||||
};
|
||||
}).ToList()
|
||||
};
|
||||
@@ -3216,6 +3214,9 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
PaymentPrice = institution.TotalAmount.ToMoney(),
|
||||
TotalPrice = (institution.TotalAmount - institution.ValueAddedTax).ToMoney(),
|
||||
TaxPrice = institution.ValueAddedTax.ToMoney(),
|
||||
OneMonthPrice = institution.ContractAmountWithTax.ToMoney(),
|
||||
OneMonthWithoutTax = institution.ContractAmount.ToMoney(),
|
||||
OneMonthTax = institution.ContractAmountTax.ToMoney(),
|
||||
VerifierFullName = institution.VerifierFullName,
|
||||
VerifierPhoneNumber = institution.VerifierPhoneNumber,
|
||||
VerifyCode = institution.VerifyCode,
|
||||
|
||||
@@ -1777,6 +1777,49 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<PagedResult<InsuranceClientListViewModel>> GetInsuranceClientList(InsuranceClientSearchModel searchModel)
|
||||
{
|
||||
var workshopId = _authHelper.GetWorkshopId();
|
||||
var query = _context.InsuranceListSet
|
||||
.Select(x => new InsuranceClientListViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
WorkShopId = x.WorkshopId,
|
||||
Year = x.Year,
|
||||
YearInt = Convert.ToInt32(x.Year),
|
||||
Month = x.Month,
|
||||
MonthName = x.Month.ToFarsiMonthByNumber(),
|
||||
MonthInt = Convert.ToInt32(x.Month),
|
||||
}).Where(x => x.WorkShopId == workshopId);
|
||||
|
||||
|
||||
if (searchModel.Year>0)
|
||||
{
|
||||
query = query.Where(x => x.YearInt == searchModel.Year);
|
||||
}
|
||||
if (searchModel.Month > 0)
|
||||
{
|
||||
query = query.Where(x => x.MonthInt == searchModel.Month);
|
||||
}
|
||||
|
||||
var res = new PagedResult<InsuranceClientListViewModel>
|
||||
{
|
||||
TotalCount = query.Count()
|
||||
};
|
||||
query = searchModel.Sorting switch
|
||||
{
|
||||
"CreationDate-Max" => query.OrderByDescending(x => x.Id),
|
||||
"CreationDate-Min" => query.OrderBy(x => x.Id),
|
||||
"Month-Max" => query.OrderByDescending(x => x.MonthInt),
|
||||
"Month-Min" => query.OrderBy(x => x.MonthInt),
|
||||
"Year-Max" => query.OrderByDescending(x => x.YearInt),
|
||||
"Year-Min" => query.OrderBy(x => x.YearInt),
|
||||
_ => query.OrderByDescending(x => x.Id),
|
||||
};
|
||||
res.List =await query.ApplyPagination(searchModel.PageIndex,searchModel.PageSize).ToListAsync();
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<List<InsuranceListViewModel>> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
if (string.IsNullOrEmpty(searchModel.Month) || string.IsNullOrEmpty(searchModel.Year))
|
||||
|
||||
@@ -1994,8 +1994,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
case "شنبه":
|
||||
w1 = 7;
|
||||
w2 = 14;
|
||||
w3 = 28;
|
||||
w4 = 31;
|
||||
w3 = 21;
|
||||
w4 = 28;
|
||||
w5 = 31;
|
||||
break;
|
||||
case "یکشنبه":
|
||||
w1 = 6;
|
||||
@@ -2361,6 +2362,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -8,8 +8,8 @@ public class CreateProjectCommandValidator:AbstractValidator<CreateProjectComman
|
||||
public CreateProjectCommandValidator()
|
||||
{
|
||||
RuleFor(x => x.Name)
|
||||
.MaximumLength(15)
|
||||
.WithMessage("نام نمیتواند بیشتر از 15 کاراکتر باشد")
|
||||
.MaximumLength(25)
|
||||
.WithMessage("نام نمیتواند بیشتر از 25 کاراکتر باشد")
|
||||
.NotEmpty()
|
||||
.NotNull()
|
||||
.WithMessage("نام نمیتواند خالی باشد");
|
||||
|
||||
@@ -68,7 +68,7 @@ public class ProjectBoardDetailQueryHandler : IBaseQueryHandler<ProjectBoardDeta
|
||||
}).ToList()
|
||||
};
|
||||
}).ToList();
|
||||
var response = new ProjectBoardDetailResponse(users, $"{totalTimeSpan.TotalHours}:{totalTimeSpan.Minutes:D2}");
|
||||
var response = new ProjectBoardDetailResponse(users, $"{(int)totalTimeSpan.TotalHours}:{totalTimeSpan.Minutes:D2}");
|
||||
return OperationResult<ProjectBoardDetailResponse>.Success(response);
|
||||
}
|
||||
}
|
||||
@@ -231,11 +231,11 @@ public static class ProgramManagerPermissionCode
|
||||
#endregion
|
||||
|
||||
|
||||
public static List<int> GetAllCodes()
|
||||
public static Dictionary<string, object> GetAllCodes()
|
||||
{
|
||||
var result = new List<int>();
|
||||
var result = new Dictionary<string, object>();
|
||||
|
||||
void Collect(Type type)
|
||||
void Collect(Type type, Dictionary<string, object> dict)
|
||||
{
|
||||
// Collect const int fields directly declared on this type
|
||||
var fields = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly);
|
||||
@@ -246,7 +246,7 @@ public static class ProgramManagerPermissionCode
|
||||
var raw = f.GetRawConstantValue();
|
||||
if (raw is int value)
|
||||
{
|
||||
result.Add(value);
|
||||
dict[f.Name] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,11 +255,16 @@ public static class ProgramManagerPermissionCode
|
||||
var nestedTypes = type.GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic);
|
||||
foreach (var nt in nestedTypes)
|
||||
{
|
||||
Collect(nt);
|
||||
var nestedDict = new Dictionary<string, object>();
|
||||
Collect(nt, nestedDict);
|
||||
if (nestedDict.Count > 0)
|
||||
{
|
||||
dict[nt.Name] = nestedDict;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Collect(typeof(ProgramManagerPermissionCode));
|
||||
Collect(typeof(ProgramManagerPermissionCode), result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -101,8 +101,8 @@ public class ProjectController : ProgramManagerBaseController
|
||||
var res = await _mediator.Send(query);
|
||||
return res;
|
||||
}
|
||||
[HttpGet("board/{id:guid}")]
|
||||
public async Task<ActionResult<OperationResult<ProjectBoardDetailResponse>>> Test(Guid id)
|
||||
[HttpGet("board/details")]
|
||||
public async Task<ActionResult<OperationResult<ProjectBoardDetailResponse>>> GetProjectBoardDetails(Guid id)
|
||||
{
|
||||
var query = new ProjectBoardDetailQuery(id);
|
||||
var res = await _mediator.Send(query);
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="row"></div>
|
||||
<div class="form-group" style="margin: 29px 7px 0px;">
|
||||
<span> فعالیت کاربر در پروگرام منیجر </span>
|
||||
<span> فعالیت کاربر در مدیریت پروژه </span>
|
||||
<span> </span>
|
||||
<label class="switch">
|
||||
<input id="checkAll" asp-for="IsProgramManagerUser" type="checkbox"/>
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="UserRoles" > نقش در پروگرام منیجر </label>
|
||||
<label asp-for="UserRoles" > انتخاب نقش در مدیریت پروژه </label>
|
||||
<select disabled="disabled" class="form-control select-city" multiple="multiple" asp-for="UserRoles" asp-items="Model.RoleList">
|
||||
<option value="0"></option>
|
||||
</select>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="row"></div>
|
||||
<div class="form-group" style="margin: 29px 7px 0px;">
|
||||
<span> فعالیت کاربر در پروگرام منیجر </span>
|
||||
<span> فعالیت کاربر درمدیریت پروژه </span>
|
||||
<span> </span>
|
||||
<label class="switch">
|
||||
<input id="editcheckAll" asp-for="IsProgramManagerUser" type="checkbox"/>
|
||||
@@ -148,7 +148,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
|
||||
<label asp-for="UserRoles"> نقش در پروگرام منیجر </label>
|
||||
<label asp-for="UserRoles"> انتخاب نقش در مدیریت پروژه </label>
|
||||
@if (Model.IsProgramManagerUser)
|
||||
{
|
||||
<select class="form-control select-city editSelect" multiple="multiple" asp-for="UserRoles" asp-items="Model.RoleList">
|
||||
|
||||
@@ -2642,8 +2642,9 @@ public class AutoExtensionModel : PageModel
|
||||
case "شنبه":
|
||||
w1 = 7;
|
||||
w2 = 14;
|
||||
w3 = 28;
|
||||
w4 = 31;
|
||||
w3 = 21;
|
||||
w4 = 28;
|
||||
w5 = 31;
|
||||
break;
|
||||
case "یکشنبه":
|
||||
w1 = 6;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
@page
|
||||
|
||||
|
||||
<h4>Deploy Log</h4>
|
||||
|
||||
<pre style="
|
||||
background:#111;
|
||||
color:#0f0;
|
||||
padding:15px;
|
||||
max-height:600px;
|
||||
overflow:auto;
|
||||
font-size:13px;
|
||||
border-radius:6px;">
|
||||
|
||||
</pre>
|
||||
@@ -2,6 +2,14 @@
|
||||
@model ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel
|
||||
@{
|
||||
ViewData["Title"] = "File Upload";
|
||||
<style>
|
||||
.lineDiv {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background-image: linear-gradient(to right, #ffffff, #e5e5e5, #cbcbcb, #b2b2b2, #9a9a9a, #9a9a9a, #9a9a9a, #9a9a9a, #b2b2b2, #cbcbcb, #e5e5e5, #ffffff);
|
||||
margin: 10px;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<h1>Upload APK File</h1>
|
||||
@@ -60,16 +68,85 @@
|
||||
</form>
|
||||
|
||||
|
||||
<form style="margin:50px" asp-page-handler="PaymentGateWay" id="11" method="post">
|
||||
<form style="margin:30px" asp-page-handler="PaymentGateWay" id="11" method="post">
|
||||
|
||||
<button type="submit">درگاه پرداخت تستی </button>
|
||||
</form>
|
||||
<div class="lineDiv"></div>
|
||||
<div class="row m-t-20">
|
||||
<div class="col-4"></div>
|
||||
<div class="col-2">
|
||||
<form asp-page-handler="UploadFrontEnd" id="12" method="post">
|
||||
<button type="submit"
|
||||
class="btn btn-danger"
|
||||
onclick="return confirm('آیا از انتشار نسخه جدید فرانت مطمئن هستید؟');">
|
||||
🚀 Deploy Next UI
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#logModal">
|
||||
مشاهده لاگ Deploy
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-4"></div>
|
||||
</div>
|
||||
<div class="lineDiv"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="logModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Deploy Log</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<pre id="logContent"
|
||||
style="background: #111;
|
||||
color: #0f0;
|
||||
padding: 15px;
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
direction: ltr;">
|
||||
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form style="margin:20px" asp-page-handler="ContractingPartyToWorkshop" id="13" method="post">
|
||||
|
||||
<button class="btn btn-outline-secondary" type="submit"> افزودن آی دی طرف حساب به کارگاه </button>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
@if (ViewData["message"] != null)
|
||||
{
|
||||
<p>@ViewData["message"]</p>
|
||||
}
|
||||
<script>
|
||||
document.getElementById('logModal')
|
||||
.addEventListener('show.bs.modal', function () {
|
||||
|
||||
fetch('?handler=Log')
|
||||
.then(r => r.text())
|
||||
.then(t => {
|
||||
document.getElementById('logContent').textContent = t;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@* <script>
|
||||
|
||||
|
||||
@@ -1,36 +1,40 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.FaceEmbedding;
|
||||
using _0_Framework.Application.PaymentGateway;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using AccountManagement.Domain.AccountLeftWorkAgg;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg.ValueObjects;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using Company.Domain.RewardAgg;
|
||||
using Company.Domain.RollCallAgg.DomainService;
|
||||
using CompanyManagement.Infrastructure.Excel.WorkshopsRollCall;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using CompanyManagment.EFCore;
|
||||
using Hangfire;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography.Xml;
|
||||
using System.Text.Json.Serialization;
|
||||
using _0_Framework.Application.PaymentGateway;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Parbad;
|
||||
using Parbad.AspNetCore;
|
||||
using Parbad.Gateway.Sepehr;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.FaceEmbedding;
|
||||
using CompanyManagement.Infrastructure.Excel.WorkshopsRollCall;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography.Xml;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using static ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel2;
|
||||
|
||||
namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
@@ -47,6 +51,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly IOnlinePayment _onlinePayment;
|
||||
private readonly IFaceEmbeddingService _faceEmbeddingService;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
|
||||
|
||||
[BindProperty] public IFormFile File { get; set; }
|
||||
@@ -61,13 +66,18 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
[Display(Name = "کد ورژن")]
|
||||
public string VersionCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لاگ آپلود فرانت
|
||||
/// </summary>
|
||||
public string LogContent { get; set; }
|
||||
|
||||
[BindProperty] public ApkType SelectedApkType { get; set; }
|
||||
[BindProperty] public bool IsForce { get; set; }
|
||||
|
||||
public IndexModel(IAndroidApkVersionApplication application, IRollCallDomainService rollCallDomainService,
|
||||
CompanyContext context, AccountContext accountContext, IHttpClientFactory httpClientFactory,
|
||||
IOptions<AppSettingConfiguration> appSetting,
|
||||
ITemporaryClientRegistrationApplication clientRegistrationApplication, IOnlinePayment onlinePayment, IFaceEmbeddingService faceEmbeddingService)
|
||||
ITemporaryClientRegistrationApplication clientRegistrationApplication, IOnlinePayment onlinePayment, IFaceEmbeddingService faceEmbeddingService, IAuthHelper authHelper)
|
||||
{
|
||||
_application = application;
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
@@ -77,6 +87,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
_clientRegistrationApplication = clientRegistrationApplication;
|
||||
_onlinePayment = onlinePayment;
|
||||
_faceEmbeddingService = faceEmbeddingService;
|
||||
_authHelper = authHelper;
|
||||
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
|
||||
}
|
||||
|
||||
@@ -292,6 +303,105 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
//TranslateCode(result?.ErrorCode);
|
||||
return Page();
|
||||
}
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 120)]
|
||||
public async Task<IActionResult> OnPostUploadFrontEnd(CancellationToken cancellationToken)
|
||||
{
|
||||
var validAccountId = _authHelper.CurrentAccountId();
|
||||
if (validAccountId == 2 || validAccountId == 322)
|
||||
{
|
||||
var batPath = @"C:\next-ui\deploy-next-ui.bat";
|
||||
|
||||
var psi = new ProcessStartInfo
|
||||
{
|
||||
FileName = batPath,
|
||||
UseShellExecute = true, // خیلی مهم
|
||||
Verb = "runas", // اجرای Administrator
|
||||
CreateNoWindow = true,
|
||||
WindowStyle = ProcessWindowStyle.Hidden
|
||||
};
|
||||
|
||||
Process.Start(psi);
|
||||
|
||||
TempData["Message"] = "فرآیند Deploy شروع شد. لاگ را بررسی کنید.";
|
||||
return RedirectToPage();
|
||||
}
|
||||
return Forbid();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// افزودن آی دی طرف حساب به کارگاه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 120)]
|
||||
public async Task<IActionResult> OnPostContractingPartyToWorkshop()
|
||||
{
|
||||
var workshops = await _context.Workshops.Where(x => x.ContractingPartyId == 0).ToListAsync();
|
||||
|
||||
var worskhopEmployeer = await _context.WorkshopEmployers.Include(x => x.Employer).ToListAsync();
|
||||
|
||||
var contractingParties = await _context.PersonalContractingParties.ToListAsync();
|
||||
|
||||
foreach (var workshop in workshops)
|
||||
{
|
||||
var employers = worskhopEmployeer.Where(x => x.WorkshopId == workshop.id);
|
||||
var contractingPartyIdList = new List<long>();
|
||||
foreach (var employer in employers)
|
||||
{
|
||||
if (contractingParties.Any(x => x.id == employer.Employer.ContractingPartyId))
|
||||
{
|
||||
contractingPartyIdList.Add(employer.Employer.ContractingPartyId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (contractingPartyIdList.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
if (contractingPartyIdList.Count == 1)
|
||||
{
|
||||
workshop.AddContractingPartyId(contractingPartyIdList[0]);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
var idDistinct = contractingPartyIdList.Distinct().ToList();
|
||||
if (idDistinct.Count == 1)
|
||||
{
|
||||
workshop.AddContractingPartyId(contractingPartyIdList[0]);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ViewData["message"] = "آی دی های طرف حساب اضافه شد";
|
||||
return Page();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لاگ آپلود فرانت
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnGetLog()
|
||||
{
|
||||
var validAccountId = _authHelper.CurrentAccountId();
|
||||
if (validAccountId == 2 || validAccountId == 322)
|
||||
{
|
||||
var logPath = @"C:\next-ui\log.txt";
|
||||
if (!System.IO.File.Exists(logPath))
|
||||
return Content("Log file not found.");
|
||||
|
||||
var content = System.IO.File.ReadAllText(logPath, Encoding.UTF8);
|
||||
return Content(content);
|
||||
}
|
||||
return Content("شما مجاز به دیدن لاگ نیستید");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async System.Threading.Tasks.Task OnGetCallback(string? transid, string? cardnumber,
|
||||
string? tracking_number, string status)
|
||||
@@ -840,8 +950,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
contract => contract.ContractingPartyId,
|
||||
contractingParty => contractingParty.id,
|
||||
(contract, contractingParty) => new { contract, contractingParty });
|
||||
|
||||
|
||||
|
||||
|
||||
var remoteContractsQuery = query
|
||||
.Where(x => x.contractingParty.Employers
|
||||
.Any(e => e.WorkshopEmployers
|
||||
|
||||
22
ServiceHost/Areas/Client/Controllers/InsuranceController.cs
Normal file
22
ServiceHost/Areas/Client/Controllers/InsuranceController.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.InsuranceList;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Controllers;
|
||||
|
||||
public class InsuranceController:ClientBaseController
|
||||
{
|
||||
private readonly IInsuranceListApplication _insuranceListApplication;
|
||||
|
||||
public InsuranceController(IInsuranceListApplication insuranceListApplication)
|
||||
{
|
||||
_insuranceListApplication = insuranceListApplication;
|
||||
}
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<PagedResult<InsuranceClientListViewModel>>> GetInsurances(InsuranceClientSearchModel searchModel)
|
||||
{
|
||||
var insurances =await _insuranceListApplication.GetInsuranceClientList(searchModel);
|
||||
return Ok(insurances);
|
||||
}
|
||||
}
|
||||
@@ -157,9 +157,10 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode,string birthDate)
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode,string birthDate, bool authorizedCanceled)
|
||||
{
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate, _workshopId);
|
||||
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate, authorizedCanceled, _workshopId);
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="AuthorizedCanceled" class="col-12 p-2 disable">
|
||||
<div id="AuthorizedCanceled" class="col-12 p-2 disable">
|
||||
<input id="authorizedCheckboxInput" type="checkbox"/>
|
||||
<label>ثبت مشخصات پرسنل بدون احراز هویت</label>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -39,7 +39,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.InsuranceList
|
||||
public string WorkshopName;
|
||||
public List<string> YearlyList;
|
||||
public string Year;
|
||||
public string Month;
|
||||
public string Month;
|
||||
public string Sorting;
|
||||
public int PageIndex;
|
||||
public string TypeOfInsurance;
|
||||
@@ -163,6 +163,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.InsuranceList
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OldClientByHeydari
|
||||
|
||||
//public IActionResult OnGetSearch(InsuranceListSearchModel searchModel)
|
||||
|
||||
@@ -777,9 +777,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode, string birthDate)
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode, string birthDate, bool? authorizedCanceled = null)
|
||||
{
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate, _workshopId);
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate,false, _workshopId);
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -546,11 +546,11 @@ namespace ServiceHost.Areas.Client.Pages
|
||||
return new JsonResult(jobViewModels);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode, string birthDate)
|
||||
public async Task<IActionResult> OnGetEmployeeDetailsWithNationalCode(string nationalCode, string birthDate, bool? authorizedCanceled = null)
|
||||
{
|
||||
var workshopSlug = User.FindFirst("WorkshopSlug")?.Value;
|
||||
long workshopIDecrypt = _passwordHasher.SlugDecrypt(workshopSlug);
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate, workshopIDecrypt);
|
||||
var result = await _employeeApplication.ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(nationalCode, birthDate,false, workshopIDecrypt);
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ using System.Security.Cryptography;
|
||||
using System.Threading;
|
||||
using CompanyManagment.App.Contracts.FinancialInvoice;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using GozareshgirProgramManager.Application._Common.Constants;
|
||||
using GozareshgirProgramManager.Infrastructure.Persistence.Context;
|
||||
|
||||
namespace ServiceHost.Controllers;
|
||||
|
||||
@@ -65,6 +67,12 @@ public class GeneralController : GeneralBaseController
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet("pm-permissions")]
|
||||
public IActionResult GetPMPermissions()
|
||||
{
|
||||
var permissions = ProgramManagerPermissionCode.GetAllCodes();
|
||||
return new JsonResult(permissions);
|
||||
}
|
||||
|
||||
[HttpGet("/api/callback"), HttpPost("/api/callback")]
|
||||
public async Task<IActionResult> Verify(SepehrGatewayPayResponse payResponse)
|
||||
|
||||
38
ServiceHost/Filters/OperationResultFilter.cs
Normal file
38
ServiceHost/Filters/OperationResultFilter.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
|
||||
namespace ServiceHost.Filters;
|
||||
|
||||
public class OperationResultFilter : ActionFilterAttribute
|
||||
{
|
||||
public override void OnActionExecuted(ActionExecutedContext context)
|
||||
{
|
||||
// بررسی کنید که درخواست برای مسیر /api/programmanager/ است
|
||||
var path = context.HttpContext.Request.Path.Value ?? string.Empty;
|
||||
if (!path.StartsWith("/api/programmanager/", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return; // اگر مسیر مطابقت ندارد، فیلتر را اعمال نکنید
|
||||
}
|
||||
|
||||
if (context.Result is ObjectResult objectResult)
|
||||
{
|
||||
if (objectResult.Value is OperationResult operationResult && !operationResult.IsSuccess)
|
||||
{
|
||||
int statusCode = GetStatusCode(operationResult.ErrorType);
|
||||
objectResult.StatusCode = statusCode;
|
||||
context.HttpContext.Response.StatusCode = statusCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int GetStatusCode(ErrorType errorType) => errorType switch
|
||||
{
|
||||
ErrorType.NotFound => StatusCodes.Status404NotFound,
|
||||
ErrorType.Unauthorized => StatusCodes.Status401Unauthorized,
|
||||
ErrorType.Validation => StatusCodes.Status400BadRequest,
|
||||
ErrorType.BadRequest => StatusCodes.Status400BadRequest,
|
||||
ErrorType.InternalServerError => StatusCodes.Status500InternalServerError,
|
||||
_ => StatusCodes.Status400BadRequest
|
||||
};
|
||||
}
|
||||
@@ -35,6 +35,7 @@ using Microsoft.OpenApi;
|
||||
using ServiceHost.Hubs.ProgramManager;
|
||||
using ServiceHost.Notifications.ProgramManager;
|
||||
using ServiceHost.Conventions;
|
||||
using ServiceHost.Filters;
|
||||
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -178,6 +179,7 @@ builder.Services.AddAuthorization(options =>
|
||||
builder.Services.AddControllers(options =>
|
||||
{
|
||||
options.Conventions.Add(new ParameterBindingConvention());
|
||||
options.Filters.Add(new OperationResultFilter());
|
||||
})
|
||||
.AddJsonOptions(options =>
|
||||
{
|
||||
|
||||
@@ -69,14 +69,14 @@ $(document).ready(function () {
|
||||
function checkInputs() {
|
||||
const genderSelected = $(".genderStatus:checked").length > 0;
|
||||
const maritalStatusSelected = $(".maritalStatus:checked").length > 0;
|
||||
|
||||
const nationality = $("#NationalitySelect").val();
|
||||
;
|
||||
const nationality = $('#NationalitySelect option:selected').length > 0;
|
||||
const fName = $("#firstName").val();
|
||||
const lName = $("#lastName").val();
|
||||
const startWork = $("#startWork").val().trim();
|
||||
const startWorkIsValidDate = /^\d{4}[-\/]\d{2}[-\/]\d{2}$/.test(startWork);
|
||||
const semat = $("#sematSelect").val();
|
||||
debugger;
|
||||
|
||||
let isEmpty = false;
|
||||
|
||||
if (!genderSelected || !maritalStatusSelected || !nationality || !fName || !lName || !startWork || !startWorkIsValidDate || semat === "0") {
|
||||
@@ -88,6 +88,11 @@ function checkInputs() {
|
||||
validateField(".validMariage", "لطفا وضعیت تاهل را مشخص کنید.");
|
||||
return false;
|
||||
}
|
||||
debugger;
|
||||
if (!nationality) {
|
||||
validateField("#NationalitySelect", "لطفا ملیت را مشخص نمایید.");
|
||||
return false;
|
||||
}
|
||||
if (!$("input[name='Command.Gender']:checked").val()) {
|
||||
validateField(".validGender", "لطفا جنسیت را مشخص کنید.");
|
||||
return false;
|
||||
|
||||
@@ -186,6 +186,14 @@ $(document).ready(function () {
|
||||
|
||||
next() {
|
||||
if (goToStep2) {
|
||||
if ($('#authorizedCheckboxInput').is(':checked')) {
|
||||
$('#nationalCodeS2Section').removeClass('disable');
|
||||
$('#birthDateS2Section').removeClass('disable');
|
||||
$('#nameS2Section').removeClass('disable');
|
||||
$('#fNameS2Section').removeClass('disable');
|
||||
$('.disablemightBeNullDB1').removeClass('disable');
|
||||
}
|
||||
|
||||
this.modal.setState(this.modal.step2);
|
||||
}
|
||||
}
|
||||
@@ -454,7 +462,17 @@ function saveFullData() {
|
||||
|
||||
formData.append("Command.CreateCustomizeEmployeeSettings.FridayWork", $('#Friday1').prop('checked') ? "Default" : "WorkInFriday");
|
||||
formData.append("Command.CreateCustomizeEmployeeSettings.HolidayWork", $('#HolidayWork1').prop('checked') ? "Default" : "WorkInHolidays");
|
||||
var authorizedCanceled = false;
|
||||
if ($('#authorizedCheckboxInput').is(':checked')) {
|
||||
//$('#nationalCodeS2Section').removeClass('disable');
|
||||
//$('#birthDateS2Section').removeClass('disable');
|
||||
//$('#nameS2Section').removeClass('disable');
|
||||
//$('#fNameS2Section').removeClass('disable');
|
||||
//$('.disablemightBeNullDB1').removeClass('disable');
|
||||
|
||||
formData.append("Command.CanceledAuthorize", true)
|
||||
|
||||
}
|
||||
let pic1 = $("#pic1").attr('src');
|
||||
let pic2 = $("#pic2").attr('src');
|
||||
if (pic1) formData.append("Command.RollCallUploadEmployeePicture.Picture1", pic1);
|
||||
|
||||
@@ -82,12 +82,24 @@ function checkNationalCode(nationalCode, birthDate) {
|
||||
checkNationalUrl = getEmployeeDataByNationalCodeUrl;
|
||||
}
|
||||
|
||||
var authorizedCanceled = false;
|
||||
if ($('#authorizedCheckboxInput').is(':checked')) {
|
||||
//$('#nationalCodeS2Section').removeClass('disable');
|
||||
//$('#birthDateS2Section').removeClass('disable');
|
||||
//$('#nameS2Section').removeClass('disable');
|
||||
//$('#fNameS2Section').removeClass('disable');
|
||||
//$('.disablemightBeNullDB1').removeClass('disable');
|
||||
|
||||
authorizedCanceled = true;
|
||||
|
||||
}
|
||||
|
||||
$("#IdentityLoading").show();
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: checkNationalUrl,
|
||||
method: "GET",
|
||||
data: { nationalCode: nationalCode, birthDate: birthDate },
|
||||
data: { nationalCode: nationalCode, birthDate: birthDate, authorizedCanceled: authorizedCanceled },
|
||||
success: (response) => {
|
||||
if (response.isSuccedded) {
|
||||
if (response.data) {
|
||||
|
||||
Reference in New Issue
Block a user