Compare commits
1 Commits
Feature/Ch
...
Feature/re
| Author | SHA1 | Date | |
|---|---|---|---|
| 8839b54dd3 |
@@ -80,6 +80,4 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
|
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
|
||||||
Task<PagedResult<CheckoutListClientDto>> GetListForClient(long workshopId,
|
|
||||||
CheckoutListClientSearchModel searchModel);
|
|
||||||
}
|
}
|
||||||
@@ -62,40 +62,4 @@ public interface ICheckoutApplication
|
|||||||
long workshopId, DateTime start, DateTime end);
|
long workshopId, DateTime start, DateTime end);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Task<PagedResult<CheckoutListClientDto>> GetListForClient(long workshopId,
|
|
||||||
CheckoutListClientSearchModel searchModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CheckoutListClientSearchModel:PaginationRequest
|
|
||||||
{
|
|
||||||
public long? EmployeeId { get; set; }
|
|
||||||
public string Year { get; set; }
|
|
||||||
public string Month { get; set; }
|
|
||||||
public string StartDate { get; set; }
|
|
||||||
public string EndDate { get; set; }
|
|
||||||
public CheckoutClientListOrderType? OrderType { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CheckoutListClientDto
|
|
||||||
{
|
|
||||||
public long Id { get; set; }
|
|
||||||
public string Year { get; set; }
|
|
||||||
public string Month { get; set; }
|
|
||||||
public string EmployeeName { get; set; }
|
|
||||||
public string ContractNo { get; set; }
|
|
||||||
public string ContractStart { get; set; }
|
|
||||||
public string ContractEnd { get; set; }
|
|
||||||
public bool Signature { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CheckoutClientListOrderType
|
|
||||||
{
|
|
||||||
ByCheckoutCreationDate,
|
|
||||||
BySignedCheckout,
|
|
||||||
ByUnSignedCheckout,
|
|
||||||
ByPersonnelCode,
|
|
||||||
ByPersonnelCodeDescending,
|
|
||||||
ByCheckoutStartDate,
|
|
||||||
ByCheckoutStartDateDescending
|
|
||||||
}
|
}
|
||||||
@@ -706,10 +706,5 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
|
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PagedResult<CheckoutListClientDto>> GetListForClient(long workshopId,CheckoutListClientSearchModel searchModel)
|
|
||||||
{
|
|
||||||
return await _checkoutRepository.GetListForClient(workshopId, searchModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -209,38 +209,22 @@ public class CreateOrEditCheckoutCommandHandler : IBaseCommandHandler<CreateOrEd
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
////حقوق نهایی
|
//حقوق نهایی
|
||||||
//var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
var monthlySalaryPay = (totalHoursWorked * monthlySalaryDefined) / mandatoryHours;
|
||||||
//// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
||||||
//monthlySalaryPay = monthlySalaryPay > monthlySalaryDefined ? monthlySalaryDefined : monthlySalaryPay;
|
monthlySalaryPay = monthlySalaryPay > monthlySalaryDefined ? monthlySalaryDefined : monthlySalaryPay;
|
||||||
|
|
||||||
////حقوق کسر شده
|
//حقوق کسر شده
|
||||||
//var deductionFromSalary = monthlySalaryDefined - monthlySalaryPay;
|
var deductionFromSalary = monthlySalaryDefined - monthlySalaryPay;
|
||||||
|
|
||||||
//new chang salary compute
|
|
||||||
var monthlySalaryPay = totalHoursWorked * monthlySalaryDefined;
|
|
||||||
|
|
||||||
//زمان باقی مانده
|
//زمان باقی مانده
|
||||||
var remainingTime = totalHoursWorked - mandatoryHours;
|
var remainingTime = totalHoursWorked - mandatoryHours;
|
||||||
|
|
||||||
|
|
||||||
//تناسب به دقیقه
|
|
||||||
#region MyRegion
|
|
||||||
|
|
||||||
//var monthlySalaryDefinedTest = monthlySalaryDefined * mandatoryHours;
|
|
||||||
//var monthlySalaryPayTest = totalHoursWorked * monthlySalaryDefined;
|
|
||||||
////// اگر اضافه کار داشت حقوق تعین شده به عنوان حقوق نهایی در نظر گرفته میشود
|
|
||||||
//monthlySalaryPayTest = monthlySalaryPayTest > monthlySalaryDefinedTest ? monthlySalaryDefinedTest : monthlySalaryPayTest;
|
|
||||||
//////حقوق کسر شده
|
|
||||||
//var deductionFromSalaryTest = monthlySalaryDefinedTest - monthlySalaryPayTest;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
var computeResult = new ComputeResultDto
|
var computeResult = new ComputeResultDto
|
||||||
{
|
{
|
||||||
MandatoryHours = mandatoryHours,
|
MandatoryHours = mandatoryHours,
|
||||||
MonthlySalaryPay = monthlySalaryPay,
|
MonthlySalaryPay = monthlySalaryPay,
|
||||||
DeductionFromSalary = 0 /*deductionFromSalary*/,
|
DeductionFromSalary = deductionFromSalary,
|
||||||
RemainingHours = remainingTime
|
RemainingHours = remainingTime
|
||||||
};
|
};
|
||||||
Console.WriteLine(mandatoryHours);
|
Console.WriteLine(mandatoryHours);
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using DNTPersianUtils.Core;
|
using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||||
using GozareshgirProgramManager.Application._Common.Interfaces;
|
|
||||||
using GozareshgirProgramManager.Application._Common.Models;
|
using GozareshgirProgramManager.Application._Common.Models;
|
||||||
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
||||||
using GozareshgirProgramManager.Domain._Common;
|
using GozareshgirProgramManager.Domain._Common;
|
||||||
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using PersianDateTime = PersianTools.Core.PersianDateTime;
|
using PersianTools.Core;
|
||||||
|
|
||||||
namespace GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
namespace GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
||||||
|
|
||||||
@@ -46,8 +45,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
|||||||
"ایجاد فیش فقط برای ماه های گذشته امکان پذیر است");
|
"ایجاد فیش فقط برای ماه های گذشته امکان پذیر است");
|
||||||
|
|
||||||
|
|
||||||
//var lastMonthStart = lastMonth;
|
var lastMonthStart = lastMonth;
|
||||||
var lastMonthEnd = ((selectedDate.ToFarsi().FindeEndOfMonth())).ToGeorgianDateTime();
|
var lastMonthEnd = lastMonth;
|
||||||
|
|
||||||
var query =
|
var query =
|
||||||
await (from u in _context.Users
|
await (from u in _context.Users
|
||||||
@@ -61,8 +60,8 @@ public class GetUserToGroupCreatingQueryHandler : IBaseQueryHandler<GetUserToGro
|
|||||||
// LEFT JOIN
|
// LEFT JOIN
|
||||||
//فیش
|
//فیش
|
||||||
join ch in _context.Checkouts
|
join ch in _context.Checkouts
|
||||||
.Where(x => x.CheckoutStartDate < lastMonthEnd
|
.Where(x => x.CheckoutStartDate < lastMonthStart
|
||||||
&& x.CheckoutEndDate > selectedDate)
|
&& x.CheckoutEndDate >= lastMonthStart)
|
||||||
on u.Id equals ch.UserId into chJoin
|
on u.Id equals ch.UserId into chJoin
|
||||||
from ch in chJoin.DefaultIfEmpty()
|
from ch in chJoin.DefaultIfEmpty()
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
|
|
||||||
var skills = await _context.Skills
|
var skills = await _context.Skills
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.OrderBy(x=>x.CreationDate)
|
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
var res = new ProjectSetTimeResponse(
|
var res = new ProjectSetTimeResponse(
|
||||||
@@ -85,7 +84,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
UserId = section?.OriginalAssignedUserId ?? 0,
|
UserId = section?.OriginalAssignedUserId ?? 0,
|
||||||
SkillId = skill.Id,
|
SkillId = skill.Id,
|
||||||
};
|
};
|
||||||
}).ToList(),
|
}).OrderBy(x => x.SkillId).ToList(),
|
||||||
task.Id,
|
task.Id,
|
||||||
level);
|
level);
|
||||||
|
|
||||||
@@ -115,7 +114,6 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
|
|
||||||
var skills = await _context.Skills
|
var skills = await _context.Skills
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.OrderBy(x=>x.CreationDate)
|
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
var res = new ProjectSetTimeResponse(
|
var res = new ProjectSetTimeResponse(
|
||||||
@@ -137,7 +135,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
UserId = section?.UserId ?? 0,
|
UserId = section?.UserId ?? 0,
|
||||||
SkillId = skill.Id,
|
SkillId = skill.Id,
|
||||||
};
|
};
|
||||||
}).ToList(),
|
}).OrderBy(x => x.SkillId).ToList(),
|
||||||
phase.Id,
|
phase.Id,
|
||||||
level);
|
level);
|
||||||
|
|
||||||
@@ -167,7 +165,6 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
|
|
||||||
var skills = await _context.Skills
|
var skills = await _context.Skills
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.OrderBy(x=>x.CreationDate)
|
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
var res = new ProjectSetTimeResponse(
|
var res = new ProjectSetTimeResponse(
|
||||||
@@ -189,7 +186,7 @@ public class ProjectSetTimeDetailsQueryHandler
|
|||||||
UserId = section?.UserId ?? 0,
|
UserId = section?.UserId ?? 0,
|
||||||
SkillId = skill.Id,
|
SkillId = skill.Id,
|
||||||
};
|
};
|
||||||
}).ToList(),
|
}).OrderBy(x => x.SkillId).ToList(),
|
||||||
project.Id,
|
project.Id,
|
||||||
level);
|
level);
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
using GozareshgirProgramManager.Application._Common.Interfaces;
|
using GozareshgirProgramManager.Application._Common.Interfaces;
|
||||||
using GozareshgirProgramManager.Application._Common.Models;
|
using GozareshgirProgramManager.Application._Common.Models;
|
||||||
using GozareshgirProgramManager.Application.Modules.TaskChat.DTOs;
|
using GozareshgirProgramManager.Application.Modules.TaskChat.DTOs;
|
||||||
using GozareshgirProgramManager.Domain.TaskChatAgg.Enums;
|
|
||||||
using MediatR;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
namespace GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
||||||
|
|
||||||
public record GetMessagesQuery(
|
public record GetMessagesQuery(
|
||||||
Guid TaskId,
|
Guid TaskId,
|
||||||
MessageType? MessageType,
|
|
||||||
int Page = 1,
|
int Page = 1,
|
||||||
int PageSize = 50
|
int PageSize = 50
|
||||||
) : IBaseQuery<PaginationResult<MessageDto>>;
|
) : IBaseQuery<PaginationResult<MessageDto>>;
|
||||||
@@ -69,12 +66,7 @@ public class GetMessagesQueryHandler : IBaseQueryHandler<GetMessagesQuery, Pagin
|
|||||||
var query = _context.TaskChatMessages
|
var query = _context.TaskChatMessages
|
||||||
.Where(m => m.TaskId == request.TaskId && !m.IsDeleted)
|
.Where(m => m.TaskId == request.TaskId && !m.IsDeleted)
|
||||||
.Include(m => m.ReplyToMessage)
|
.Include(m => m.ReplyToMessage)
|
||||||
.OrderBy(m => m.CreationDate).AsQueryable();
|
.OrderBy(m => m.CreationDate);
|
||||||
|
|
||||||
if (request.MessageType.HasValue)
|
|
||||||
{
|
|
||||||
query = query.Where(m => m.MessageType == request.MessageType.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
var totalCount = await query.CountAsync(cancellationToken);
|
var totalCount = await query.CountAsync(cancellationToken);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using GozareshgirProgramManager.Application.Modules.TaskChat.DTOs;
|
|||||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetMessages;
|
||||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetPinnedMessages;
|
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.GetPinnedMessages;
|
||||||
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.SearchMessages;
|
using GozareshgirProgramManager.Application.Modules.TaskChat.Queries.SearchMessages;
|
||||||
using GozareshgirProgramManager.Domain.TaskChatAgg.Enums;
|
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using ServiceHost.BaseControllers;
|
using ServiceHost.BaseControllers;
|
||||||
@@ -31,17 +30,15 @@ public class TaskChatController : ProgramManagerBaseController
|
|||||||
/// دریافت لیست پیامهای یک تسک
|
/// دریافت لیست پیامهای یک تسک
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="taskId">شناسه تسک</param>
|
/// <param name="taskId">شناسه تسک</param>
|
||||||
/// <param name="messageType">نوع پیام</param>
|
|
||||||
/// <param name="page">صفحه (پیشفرض: 1)</param>
|
/// <param name="page">صفحه (پیشفرض: 1)</param>
|
||||||
/// <param name="pageSize">تعداد در هر صفحه (پیشفرض: 50)</param>
|
/// <param name="pageSize">تعداد در هر صفحه (پیشفرض: 50)</param>
|
||||||
[HttpGet("{taskId:guid}/messages")]
|
[HttpGet("{taskId:guid}/messages")]
|
||||||
public async Task<ActionResult<OperationResult<PaginationResult<MessageDto>>>> GetMessages(
|
public async Task<ActionResult<OperationResult<PaginationResult<MessageDto>>>> GetMessages(
|
||||||
Guid taskId,
|
Guid taskId,
|
||||||
[FromQuery] MessageType? messageType,
|
|
||||||
[FromQuery] int page = 1,
|
[FromQuery] int page = 1,
|
||||||
[FromQuery] int pageSize = 50)
|
[FromQuery] int pageSize = 50)
|
||||||
{
|
{
|
||||||
var query = new GetMessagesQuery(taskId,messageType, page, pageSize);
|
var query = new GetMessagesQuery(taskId, page, pageSize);
|
||||||
var result = await _mediator.Send(query);
|
var result = await _mediator.Send(query);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
using _0_Framework.Application;
|
|
||||||
using CompanyManagment.App.Contracts.Checkout;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using ServiceHost.BaseControllers;
|
|
||||||
|
|
||||||
namespace ServiceHost.Areas.Client.Controllers;
|
|
||||||
|
|
||||||
public class CheckoutController:ClientBaseController
|
|
||||||
{
|
|
||||||
private readonly ICheckoutApplication _checkoutApplication;
|
|
||||||
private readonly long _workshopId;
|
|
||||||
|
|
||||||
public CheckoutController(ICheckoutApplication checkoutApplication,IAuthHelper authHelper)
|
|
||||||
{
|
|
||||||
_checkoutApplication = checkoutApplication;
|
|
||||||
_workshopId = authHelper.GetWorkshopId();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public async Task<ActionResult<PagedResult<CheckoutListClientDto>>> GetList(CheckoutListClientSearchModel searchModel)
|
|
||||||
{
|
|
||||||
var res =await _checkoutApplication.GetListForClient(_workshopId, searchModel);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
53
ServiceHost/Areas/Client/Controllers/RewardController.cs
Normal file
53
ServiceHost/Areas/Client/Controllers/RewardController.cs
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
using _0_Framework.Application;
|
||||||
|
using CompanyManagment.App.Contracts.Reward;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using ServiceHost.BaseControllers;
|
||||||
|
|
||||||
|
namespace ServiceHost.Areas.Client.Controllers;
|
||||||
|
|
||||||
|
public class RewardController:ClientBaseController
|
||||||
|
{
|
||||||
|
private readonly IRewardApplication _rewardApplication;
|
||||||
|
private readonly long _workshopId;
|
||||||
|
|
||||||
|
public RewardController(IRewardApplication rewardApplication, IAuthHelper authHelper)
|
||||||
|
{
|
||||||
|
_rewardApplication = rewardApplication;
|
||||||
|
_workshopId = authHelper.GetWorkshopId();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public ActionResult<RewardsGroupedViewModel> GetList(RewardSearchModel searchModel)
|
||||||
|
{
|
||||||
|
searchModel.WorkshopId = _workshopId;
|
||||||
|
var res = _rewardApplication.GetSearchListAsGrouped(searchModel);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public ActionResult<OperationResult> Create(CreateRewardViewModel create)
|
||||||
|
{
|
||||||
|
create.WorkshopId = _workshopId;
|
||||||
|
return _rewardApplication.Create(create);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut]
|
||||||
|
public ActionResult<OperationResult> Edit(EditRewardViewModel edit)
|
||||||
|
{
|
||||||
|
edit.WorkshopId = _workshopId;
|
||||||
|
return _rewardApplication.Edit(edit);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete]
|
||||||
|
public ActionResult<OperationResult> Delete(long id)
|
||||||
|
{
|
||||||
|
return _rewardApplication.Remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("{id:long}")]
|
||||||
|
public ActionResult<EditRewardViewModel> Details(long id)
|
||||||
|
{
|
||||||
|
return _rewardApplication.GetDetails(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user