diff --git a/CompanyManagment.App.Contracts/Checkout/ICheckoutApplication.cs b/CompanyManagment.App.Contracts/Checkout/ICheckoutApplication.cs
index fde532f6..cdc831af 100644
--- a/CompanyManagment.App.Contracts/Checkout/ICheckoutApplication.cs
+++ b/CompanyManagment.App.Contracts/Checkout/ICheckoutApplication.cs
@@ -79,7 +79,7 @@ public interface ICheckoutApplication
///
///
///
- Task GetRotatingShift(long id);
+ Task GetRotatingShiftApi(long id);
#endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.Application/CheckoutApplication.cs b/CompanyManagment.Application/CheckoutApplication.cs
index 5b171b36..1681fe34 100644
--- a/CompanyManagment.Application/CheckoutApplication.cs
+++ b/CompanyManagment.Application/CheckoutApplication.cs
@@ -731,59 +731,46 @@ public class CheckoutApplication : ICheckoutApplication
}
- public async Task GetRotatingShift(long id)
+ public async Task GetRotatingShiftApi(long id)
{
+ var result = new ComputingViewModel();
var checkout = GetDetails(id);
var workingHours = _workingHoursTempRepository.GetByContractIdConvertToShiftwork4(checkout.ContractId);
-
+ var typeOfWorkingHours = "";
if (checkout.HasRollCall)
{
- var result = await _rollCallMandatoryRepository.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, true, workingHours, false);
- var items = result.RotatingResultList.Select(x => new RotatingShiftListDto()
- {
- MorningShiftSpan = x.MorningString,
- EveningShiftSpan = x.EveningString,
- NightShiftSpan = x.NightString,
+ result = await _rollCallMandatoryRepository.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, true, workingHours, false);
+ typeOfWorkingHours = "دارای حضورغیاب";
- IsMorningShift = x.IsMorningShift,
- IsEveningShift = x.IsEveningShift,
- IsNightShift = x.IsNightShift,
-
- ShiftDate = x.RotatingDate
- }).ToList();
- return new RotatingShiftOfCheckoutDto()
- {
- FullName = checkout.EmployeeFullName,
- YearAndMonth = $"{checkout.Month} {checkout.Year}",
- HasRotatingShift = result.RotatingStatus == "نوبت کاری ندارد",
- RotatingShiftStatus = result.RotatingStatus,
- TypeOfWorkingHours = "دارای حضورغیاب",
- RotatingShiftList = items
- };
}
else
{
- var ConvertYear = checkout.ContractStart.Substring(0, 4);
- var ConvertMonth = checkout.ContractStart.Substring(5, 2);
-
- //var contract = _contractApplication.GetDetails(checkout.ContractId);
- var workshop = _workshopRepository.GetDetails(checkout.WorkshopId);
- //var separation = _contractApplication.contractSeparation(ConvertYear, ConvertMonth,
- // contract.ContractStartGr, contract.ContractEndGr, contract.EmployeeId, contract.WorkshopIds);
- //workingHours.ContractStartGr = separation.ContractStartGr;
- //workingHours.ContractEndGr = separation.ContractEndGr;
- //workingHours.ContarctStart = separation.ContarctStart;
- //workingHours.ContractEnd = separation.ContractEnd;
- //workingHours.GetWorkDate = contract.GetWorkDate;
- //workingHours.GetWorkDateHide = contract.GetWorkDate;
- //workingHours.WorkshopId = contract.WorkshopIds;
- //workingHours.EmployeeId = contract.EmployeeId;
-
- var result = await _rollCallMandatoryRepository.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, false, workingHours, workshop.WorkshopHolidayWorking);
+ var workshop = _workshopRepository.GetDetails(checkout.WorkshopId);
+ result = await _rollCallMandatoryRepository.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, false, workingHours, workshop.WorkshopHolidayWorking);
+ typeOfWorkingHours = "بدون حضورغیاب";
}
+ var items = result.RotatingResultList.Select(x => new RotatingShiftListDto()
+ {
+ MorningShiftSpan = x.MorningString,
+ EveningShiftSpan = x.EveningString,
+ NightShiftSpan = x.NightString,
- return new RotatingShiftOfCheckoutDto();
+ IsMorningShift = x.IsMorningShift,
+ IsEveningShift = x.IsEveningShift,
+ IsNightShift = x.IsNightShift,
+
+ ShiftDate = x.RotatingDate
+ }).ToList();
+ return new RotatingShiftOfCheckoutDto()
+ {
+ FullName = checkout.EmployeeFullName,
+ YearAndMonth = $"{checkout.Month} {checkout.Year}",
+ HasRotatingShift = result.RotatingStatus != "نوبت کاری ندارد",
+ RotatingShiftStatus = result.RotatingStatus,
+ TypeOfWorkingHours = typeOfWorkingHours,
+ RotatingShiftList = items
+ };
}
#endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs
index 2bc69ffe..ebd90777 100644
--- a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs
+++ b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs
@@ -1607,6 +1607,11 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll
#region Entities
+ if (string.IsNullOrWhiteSpace(command.ContarctStart) || string.IsNullOrWhiteSpace(command.ContractEnd))
+ {
+ command.ContarctStart = command.ContractStartGr.ToFarsi();
+ command.ContractEnd = command.ContractEndGr.ToFarsi();
+ }
var sdate = command.ContarctStart.ToEnglishNumber();
var edate = command.ContractEnd.ToEnglishNumber();
var syear = Convert.ToInt32(sdate.Substring(0, 4));
diff --git a/ServiceHost/Areas/Admin/Controllers/CheckoutController.cs b/ServiceHost/Areas/Admin/Controllers/CheckoutController.cs
index b8ef27ba..8f3df3e9 100644
--- a/ServiceHost/Areas/Admin/Controllers/CheckoutController.cs
+++ b/ServiceHost/Areas/Admin/Controllers/CheckoutController.cs
@@ -21,10 +21,23 @@ public class CheckoutController : AdminBaseController
///
///
///
- [HttpGet("GetList")]
+ [HttpGet]
public async Task>> GetList(CheckoutSearchModelDto searchModel)
{
return await _checkoutApplication.GetList(searchModel);
}
+
+ ///
+ /// دریافت نوبت کاری
+ ///
+ ///
+ ///
+ [HttpGet("RotatingShift")]
+ public async Task GetRotatingShift(long id)
+ {
+ var result =await _checkoutApplication.GetRotatingShiftApi(id);
+ return result;
+ }
+
}