Event Widget düzeltmesi
This commit is contained in:
parent
ab656ba070
commit
d81ca4cd2f
19 changed files with 278 additions and 374 deletions
|
|
@ -1,14 +0,0 @@
|
||||||
using System;
|
|
||||||
using Sozsoft.Platform.Identity.Dto;
|
|
||||||
|
|
||||||
namespace Sozsoft.Platform.Intranet;
|
|
||||||
|
|
||||||
public class EventCommentDto
|
|
||||||
{
|
|
||||||
public string Id { get; set; }
|
|
||||||
public UserInfoViewModel User { get; set; }
|
|
||||||
public string Content { get; set; }
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
public int Likes { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,22 +1,21 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Sozsoft.Platform.Identity.Dto;
|
using Sozsoft.Platform.Identity.Dto;
|
||||||
|
|
||||||
namespace Sozsoft.Platform.Intranet;
|
namespace Sozsoft.Platform.Intranet;
|
||||||
|
|
||||||
public class EventDto
|
public class EventDto
|
||||||
{
|
{
|
||||||
public string Id { get; set; }
|
public Guid? TenantId { get; set; }
|
||||||
|
public Guid Id { get; set; }
|
||||||
public string CategoryName { get; set; }
|
public string CategoryName { get; set; }
|
||||||
public string TypeName { get; set; }
|
public string TypeName { get; set; }
|
||||||
public DateTime Date { get; set; }
|
public DateTime Date { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string Place { get; set; }
|
public string Place { get; set; }
|
||||||
public UserInfoViewModel Organizer { get; set; }
|
|
||||||
public int Participants { get; set; }
|
public UserInfoViewModel User { get; set; }
|
||||||
public List<string> Photos { get; set; } = new();
|
public int ParticipantsCount { get; set; }
|
||||||
public List<EventCommentDto> Comments { get; set; } = new();
|
|
||||||
public int Likes { get; set; }
|
public int Likes { get; set; }
|
||||||
public bool IsPublished { get; set; }
|
public bool IsPublished { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,8 @@ public class IdentityAutoMapperProfile : Profile
|
||||||
.ForMember(dest => dest.WorkHours, opt => opt.Ignore())
|
.ForMember(dest => dest.WorkHours, opt => opt.Ignore())
|
||||||
.ForMember(dest => dest.Departments, opt => opt.Ignore())
|
.ForMember(dest => dest.Departments, opt => opt.Ignore())
|
||||||
.ForMember(dest => dest.JobPositions, opt => opt.Ignore())
|
.ForMember(dest => dest.JobPositions, opt => opt.Ignore())
|
||||||
.ForMember(dest => dest.userRoleNames, opt => opt.Ignore());
|
.ForMember(dest => dest.userRoleNames, opt => opt.Ignore())
|
||||||
|
.AfterMap((source, destination) => destination.MapIdentityExtraProperties(source));
|
||||||
CreateMap<OrganizationUnit, OrganizationUnitDto>();
|
CreateMap<OrganizationUnit, OrganizationUnitDto>();
|
||||||
CreateMap<CreateUpdateOrganizationUnitDto, OrganizationUnit>();
|
CreateMap<CreateUpdateOrganizationUnitDto, OrganizationUnit>();
|
||||||
CreateMap<Tenant, CustomTenantDto>();
|
CreateMap<Tenant, CustomTenantDto>();
|
||||||
|
|
|
||||||
|
|
@ -159,38 +159,10 @@ public class PlatformIdentityAppService : ApplicationService
|
||||||
PhoneNumberConfirmed = user.PhoneNumberConfirmed,
|
PhoneNumberConfirmed = user.PhoneNumberConfirmed,
|
||||||
AccessFailedCount = user.AccessFailedCount,
|
AccessFailedCount = user.AccessFailedCount,
|
||||||
ShouldChangePasswordOnNextLogin = user.ShouldChangePasswordOnNextLogin,
|
ShouldChangePasswordOnNextLogin = user.ShouldChangePasswordOnNextLogin,
|
||||||
RocketUsername = user.GetRocketUsername(),
|
|
||||||
WorkHour = user.GetWorkHour(),
|
|
||||||
DepartmentId = user.GetDepartmentId(),
|
|
||||||
JobPositionId = user.GetJobPositionId(),
|
|
||||||
CreationTime = user.CreationTime,
|
CreationTime = user.CreationTime,
|
||||||
LastModificationTime = user.LastModificationTime,
|
LastModificationTime = user.LastModificationTime,
|
||||||
|
|
||||||
IdentityNumber = user.GetIdentityNumber(),
|
}.MapIdentityExtraProperties(user);
|
||||||
Nationality = user.GetNationality(),
|
|
||||||
SskNo = user.GetSskNo(),
|
|
||||||
HireDate = user.GetHireDate(),
|
|
||||||
TerminationDate = user.GetTerminationDate(),
|
|
||||||
SerialNo = user.GetSerialNo(),
|
|
||||||
Province = user.GetProvince(),
|
|
||||||
District = user.GetDistrict(),
|
|
||||||
Village = user.GetVillage(),
|
|
||||||
VolumeNo = user.GetVolumeNo(),
|
|
||||||
FamilySequenceNo = user.GetFamilySequenceNo(),
|
|
||||||
SequenceNo = user.GetSequenceNo(),
|
|
||||||
IssuedPlace = user.GetIssuedPlace(),
|
|
||||||
IssuedDate = user.GetIssuedDate(),
|
|
||||||
BirthPlace = user.GetBirthPlace(),
|
|
||||||
BirthDate = user.GetBirthDate(),
|
|
||||||
FatherName = user.GetFatherName(),
|
|
||||||
MotherName = user.GetMotherName(),
|
|
||||||
MaritalStatus = user.GetMaritalStatus(),
|
|
||||||
MarriageDate = user.GetMarriageDate(),
|
|
||||||
HomeAddress = user.GetHomeAddress(),
|
|
||||||
EducationLevel = user.GetEducationLevel(),
|
|
||||||
GraduationSchool = user.GetGraduationSchool(),
|
|
||||||
BloodType = user.GetBloodType(),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdatePermissionAsync(UserInfoViewModel UserInfo)
|
public async Task UpdatePermissionAsync(UserInfoViewModel UserInfo)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Sozsoft.Platform.Entities;
|
||||||
|
using Sozsoft.Platform.Extensions;
|
||||||
|
using Sozsoft.Platform.Identity.Dto;
|
||||||
|
using Volo.Abp.Identity;
|
||||||
|
|
||||||
|
namespace Sozsoft.Platform.Identity;
|
||||||
|
|
||||||
|
public static class UserInfoViewModelMappingExtensions
|
||||||
|
{
|
||||||
|
public static UserInfoViewModel MapIdentityExtraProperties(this UserInfoViewModel userInfoViewModel, IdentityUser user)
|
||||||
|
{
|
||||||
|
userInfoViewModel.IsVerified = user.GetIsVerified();
|
||||||
|
userInfoViewModel.LoginEndDate = user.GetLoginEndDate();
|
||||||
|
userInfoViewModel.RocketUsername = user.GetRocketUsername();
|
||||||
|
userInfoViewModel.WorkHour = user.GetWorkHour();
|
||||||
|
userInfoViewModel.DepartmentId = user.GetDepartmentId();
|
||||||
|
userInfoViewModel.JobPositionId = user.GetJobPositionId();
|
||||||
|
userInfoViewModel.Nationality = user.GetNationality();
|
||||||
|
userInfoViewModel.SskNo = user.GetSskNo();
|
||||||
|
userInfoViewModel.HireDate = user.GetHireDate();
|
||||||
|
userInfoViewModel.TerminationDate = user.GetTerminationDate();
|
||||||
|
userInfoViewModel.IdentityNumber = user.GetIdentityNumber();
|
||||||
|
userInfoViewModel.SerialNo = user.GetSerialNo();
|
||||||
|
userInfoViewModel.Province = user.GetProvince();
|
||||||
|
userInfoViewModel.District = user.GetDistrict();
|
||||||
|
userInfoViewModel.Village = user.GetVillage();
|
||||||
|
userInfoViewModel.VolumeNo = user.GetVolumeNo();
|
||||||
|
userInfoViewModel.FamilySequenceNo = user.GetFamilySequenceNo();
|
||||||
|
userInfoViewModel.SequenceNo = user.GetSequenceNo();
|
||||||
|
userInfoViewModel.IssuedPlace = user.GetIssuedPlace();
|
||||||
|
userInfoViewModel.IssuedDate = user.GetIssuedDate();
|
||||||
|
userInfoViewModel.BirthPlace = user.GetBirthPlace();
|
||||||
|
userInfoViewModel.BirthDate = user.GetBirthDate();
|
||||||
|
userInfoViewModel.FatherName = user.GetFatherName();
|
||||||
|
userInfoViewModel.MotherName = user.GetMotherName();
|
||||||
|
userInfoViewModel.MaritalStatus = user.GetMaritalStatus();
|
||||||
|
userInfoViewModel.MarriageDate = user.GetMarriageDate();
|
||||||
|
userInfoViewModel.HomeAddress = user.GetHomeAddress();
|
||||||
|
userInfoViewModel.EducationLevel = user.GetEducationLevel();
|
||||||
|
userInfoViewModel.GraduationSchool = user.GetGraduationSchool();
|
||||||
|
userInfoViewModel.BloodType = user.GetBloodType();
|
||||||
|
|
||||||
|
return userInfoViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UserInfoViewModel MapDepartmentAndJobPositionAssignments(
|
||||||
|
this UserInfoViewModel userInfoViewModel,
|
||||||
|
IReadOnlyDictionary<Guid, string> departmentDict,
|
||||||
|
IReadOnlyDictionary<Guid, JobPosition> jobPositionDict)
|
||||||
|
{
|
||||||
|
if (userInfoViewModel.DepartmentId != Guid.Empty && departmentDict.TryGetValue(userInfoViewModel.DepartmentId, out var departmentName))
|
||||||
|
{
|
||||||
|
userInfoViewModel.Departments =
|
||||||
|
[
|
||||||
|
new AssignedDepartmentViewModel
|
||||||
|
{
|
||||||
|
Id = userInfoViewModel.DepartmentId,
|
||||||
|
Name = departmentName,
|
||||||
|
IsAssigned = true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userInfoViewModel.JobPositionId != Guid.Empty && jobPositionDict.TryGetValue(userInfoViewModel.JobPositionId, out var jobPosition))
|
||||||
|
{
|
||||||
|
userInfoViewModel.JobPositions =
|
||||||
|
[
|
||||||
|
new AssignedJobPoisitionViewModel
|
||||||
|
{
|
||||||
|
Id = userInfoViewModel.JobPositionId,
|
||||||
|
Name = jobPosition.Name,
|
||||||
|
DepartmentId = jobPosition.DepartmentId,
|
||||||
|
IsAssigned = true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return userInfoViewModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ using Microsoft.Extensions.Logging;
|
||||||
using Sozsoft.Platform.BlobStoring;
|
using Sozsoft.Platform.BlobStoring;
|
||||||
using Sozsoft.Platform.Entities;
|
using Sozsoft.Platform.Entities;
|
||||||
using Sozsoft.Platform.FileManagement;
|
using Sozsoft.Platform.FileManagement;
|
||||||
|
using Sozsoft.Platform.Identity;
|
||||||
using Sozsoft.Platform.Identity.Dto;
|
using Sozsoft.Platform.Identity.Dto;
|
||||||
using Sozsoft.Platform.Extensions;
|
using Sozsoft.Platform.Extensions;
|
||||||
using Volo.Abp.Domain.Repositories;
|
using Volo.Abp.Domain.Repositories;
|
||||||
|
|
@ -27,6 +28,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
private readonly BlobManager _blobContainer;
|
private readonly BlobManager _blobContainer;
|
||||||
private readonly IConfiguration _configuration;
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
private readonly IRepository<Event, Guid> _eventRepository;
|
||||||
private readonly IIdentityUserAppService _identityUserAppService;
|
private readonly IIdentityUserAppService _identityUserAppService;
|
||||||
private readonly IIdentityUserRepository _identityUserRepository;
|
private readonly IIdentityUserRepository _identityUserRepository;
|
||||||
private readonly IRepository<Department, Guid> _departmentRepository;
|
private readonly IRepository<Department, Guid> _departmentRepository;
|
||||||
|
|
@ -46,6 +48,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
BlobManager blobContainer,
|
BlobManager blobContainer,
|
||||||
IConfiguration configuration,
|
IConfiguration configuration,
|
||||||
|
|
||||||
|
IRepository<Event, Guid> eventRepository,
|
||||||
IIdentityUserAppService identityUserAppService,
|
IIdentityUserAppService identityUserAppService,
|
||||||
IIdentityUserRepository identityUserRepository,
|
IIdentityUserRepository identityUserRepository,
|
||||||
IRepository<Department, Guid> departmentRepository,
|
IRepository<Department, Guid> departmentRepository,
|
||||||
|
|
@ -64,6 +67,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
_currentTenant = currentTenant;
|
_currentTenant = currentTenant;
|
||||||
_blobContainer = blobContainer;
|
_blobContainer = blobContainer;
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
|
_eventRepository = eventRepository;
|
||||||
_identityUserAppService = identityUserAppService;
|
_identityUserAppService = identityUserAppService;
|
||||||
_identityUserRepository = identityUserRepository;
|
_identityUserRepository = identityUserRepository;
|
||||||
_departmentRepository = departmentRepository;
|
_departmentRepository = departmentRepository;
|
||||||
|
|
@ -89,9 +93,87 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
Announcements = await GetAnnouncementsAsync(), //3
|
Announcements = await GetAnnouncementsAsync(), //3
|
||||||
Surveys = await GetSurveysAsync(), //4
|
Surveys = await GetSurveysAsync(), //4
|
||||||
SocialPosts = await GetSocialPostsAsync(), //5
|
SocialPosts = await GetSocialPostsAsync(), //5
|
||||||
|
Events = await GetUpcomingEventsAsync(), //6
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task<(Dictionary<Guid, string> DepartmentDict, Dictionary<Guid, JobPosition> JobPositionDict)> GetUserLookupDictionariesAsync()
|
||||||
|
{
|
||||||
|
var departments = await _departmentRepository.GetListAsync();
|
||||||
|
var jobPositions = await _jobPositionRepository.GetListAsync();
|
||||||
|
|
||||||
|
return (
|
||||||
|
departments.ToDictionary(d => d.Id, d => d.Name),
|
||||||
|
jobPositions.ToDictionary(j => j.Id, j => j)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private UserInfoViewModel MapUserInfoViewModel(
|
||||||
|
IdentityUser user,
|
||||||
|
IReadOnlyDictionary<Guid, string> departmentDict,
|
||||||
|
IReadOnlyDictionary<Guid, JobPosition> jobPositionDict)
|
||||||
|
{
|
||||||
|
return ObjectMapper
|
||||||
|
.Map<IdentityUser, UserInfoViewModel>(user)
|
||||||
|
.MapDepartmentAndJobPositionAssignments(departmentDict, jobPositionDict);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<List<EventDto>> GetUpcomingEventsAsync()
|
||||||
|
{
|
||||||
|
var queryable = await _eventRepository
|
||||||
|
.WithDetailsAsync(e => e.Category, e => e.Type);
|
||||||
|
|
||||||
|
var events = await AsyncExecuter.ToListAsync(
|
||||||
|
queryable.Where(e => e.isPublished).OrderByDescending(e => e.CreationTime)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (events.Count == 0)
|
||||||
|
return [];
|
||||||
|
|
||||||
|
// Tüm unique user ID'lerini topla (event'ler ve comment'ler için)
|
||||||
|
var userIds = new HashSet<Guid>();
|
||||||
|
foreach (var evt in events)
|
||||||
|
{
|
||||||
|
if (evt.UserId.HasValue)
|
||||||
|
{
|
||||||
|
userIds.Add(evt.UserId.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync();
|
||||||
|
|
||||||
|
var users = await _identityUserRepository.GetListAsync();
|
||||||
|
var userDict = users
|
||||||
|
.Where(u => userIds.Contains(u.Id))
|
||||||
|
.ToDictionary(u => u.Id, u => MapUserInfoViewModel(u, departmentDict, jobPositionDict));
|
||||||
|
|
||||||
|
var result = new List<EventDto>();
|
||||||
|
foreach (var evt in events)
|
||||||
|
{
|
||||||
|
if (!evt.UserId.HasValue || !userDict.TryGetValue(evt.UserId.Value, out var user))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var calendarEvent = new EventDto
|
||||||
|
{
|
||||||
|
Id = evt.Id,
|
||||||
|
Name = evt.Name,
|
||||||
|
Description = evt.Description,
|
||||||
|
TypeName = evt.Type?.Name,
|
||||||
|
CategoryName = evt.Category?.Name,
|
||||||
|
Date = evt.Date,
|
||||||
|
Place = evt.Place,
|
||||||
|
User = user,
|
||||||
|
ParticipantsCount = evt.ParticipantsCount,
|
||||||
|
Likes = evt.Likes,
|
||||||
|
IsPublished = evt.isPublished
|
||||||
|
};
|
||||||
|
|
||||||
|
result.Add(calendarEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private async Task<List<UserInfoViewModel>> GetBirthdaysAsync()
|
private async Task<List<UserInfoViewModel>> GetBirthdaysAsync()
|
||||||
{
|
{
|
||||||
var today = DateTime.Now;
|
var today = DateTime.Now;
|
||||||
|
|
@ -108,44 +190,11 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var allDepartments = await _departmentRepository.GetListAsync();
|
var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync();
|
||||||
var departmentDict = allDepartments.ToDictionary(d => d.Id, d => d.Name);
|
|
||||||
|
|
||||||
var allJobPositions = await _jobPositionRepository.GetListAsync();
|
return userList
|
||||||
var jobPositionDict = allJobPositions.ToDictionary(j => j.Id, j => j);
|
.Select(user => MapUserInfoViewModel(user, departmentDict, jobPositionDict))
|
||||||
|
.ToList();
|
||||||
var result = ObjectMapper.Map<List<IdentityUser>, List<UserInfoViewModel>>(userList);
|
|
||||||
|
|
||||||
for (var i = 0; i < userList.Count; i++)
|
|
||||||
{
|
|
||||||
var user = userList[i];
|
|
||||||
|
|
||||||
result[i].BirthDate = user.GetBirthDate();
|
|
||||||
result[i].WorkHour = user.GetWorkHour();
|
|
||||||
result[i].Nationality = user.GetNationality();
|
|
||||||
|
|
||||||
var deptId = user.GetDepartmentId();
|
|
||||||
if (deptId != Guid.Empty && departmentDict.TryGetValue(deptId, out var deptName))
|
|
||||||
{
|
|
||||||
result[i].DepartmentId = deptId;
|
|
||||||
result[i].Departments =
|
|
||||||
[
|
|
||||||
new AssignedDepartmentViewModel { Id = deptId, Name = deptName, IsAssigned = true }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
var jobPosId = user.GetJobPositionId();
|
|
||||||
if (jobPosId != Guid.Empty && jobPositionDict.TryGetValue(jobPosId, out var jobPosition))
|
|
||||||
{
|
|
||||||
result[i].JobPositionId = jobPosId;
|
|
||||||
result[i].JobPositions =
|
|
||||||
[
|
|
||||||
new AssignedJobPoisitionViewModel { Id = jobPosId, Name = jobPosition.Name, DepartmentId = jobPosition.DepartmentId, IsAssigned = true }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<AnnouncementDto>> GetAnnouncementsAsync()
|
private async Task<List<AnnouncementDto>> GetAnnouncementsAsync()
|
||||||
|
|
@ -153,11 +202,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
var announcements = await _announcementRepository.GetListAsync();
|
var announcements = await _announcementRepository.GetListAsync();
|
||||||
var announcementDtos = new List<AnnouncementDto>();
|
var announcementDtos = new List<AnnouncementDto>();
|
||||||
|
|
||||||
var allDepartments = await _departmentRepository.GetListAsync();
|
var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync();
|
||||||
var departmentDict = allDepartments.ToDictionary(d => d.Id, d => d.Name);
|
|
||||||
|
|
||||||
var allJobPositions = await _jobPositionRepository.GetListAsync();
|
|
||||||
var jobPositionDict = allJobPositions.ToDictionary(j => j.Id, j => j);
|
|
||||||
|
|
||||||
foreach (var announcement in announcements)
|
foreach (var announcement in announcements)
|
||||||
{
|
{
|
||||||
|
|
@ -166,33 +211,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
var user = await _identityUserRepository.FindAsync(announcement.UserId ?? Guid.Empty);
|
var user = await _identityUserRepository.FindAsync(announcement.UserId ?? Guid.Empty);
|
||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
var userVm = ObjectMapper.Map<IdentityUser, UserInfoViewModel>(user);
|
dto.User = MapUserInfoViewModel(user, departmentDict, jobPositionDict);
|
||||||
|
|
||||||
userVm.BirthDate = user.GetBirthDate();
|
|
||||||
userVm.WorkHour = user.GetWorkHour();
|
|
||||||
userVm.Nationality = user.GetNationality();
|
|
||||||
|
|
||||||
var deptId = user.GetDepartmentId();
|
|
||||||
if (deptId != Guid.Empty && departmentDict.TryGetValue(deptId, out var deptName))
|
|
||||||
{
|
|
||||||
userVm.DepartmentId = deptId;
|
|
||||||
userVm.Departments =
|
|
||||||
[
|
|
||||||
new AssignedDepartmentViewModel { Id = deptId, Name = deptName, IsAssigned = true }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
var jobPosId = user.GetJobPositionId();
|
|
||||||
if (jobPosId != Guid.Empty && jobPositionDict.TryGetValue(jobPosId, out var jobPosition))
|
|
||||||
{
|
|
||||||
userVm.JobPositionId = jobPosId;
|
|
||||||
userVm.JobPositions =
|
|
||||||
[
|
|
||||||
new AssignedJobPoisitionViewModel { Id = jobPosId, Name = jobPosition.Name, DepartmentId = jobPosition.DepartmentId, IsAssigned = true }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
dto.User = userVm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
announcementDtos.Add(dto);
|
announcementDtos.Add(dto);
|
||||||
|
|
@ -264,44 +283,12 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
|
|
||||||
if (userIds.Count > 0)
|
if (userIds.Count > 0)
|
||||||
{
|
{
|
||||||
var allDepartments = await _departmentRepository.GetListAsync();
|
var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync();
|
||||||
var departmentDict = allDepartments.ToDictionary(d => d.Id, d => d.Name);
|
|
||||||
|
|
||||||
var allJobPositions = await _jobPositionRepository.GetListAsync();
|
|
||||||
var jobPositionDict = allJobPositions.ToDictionary(j => j.Id, j => j);
|
|
||||||
|
|
||||||
var users = await _identityUserRepository.GetListAsync();
|
var users = await _identityUserRepository.GetListAsync();
|
||||||
var userMap = users
|
var userMap = users
|
||||||
.Where(u => userIds.Contains(u.Id))
|
.Where(u => userIds.Contains(u.Id))
|
||||||
.ToDictionary(u => u.Id, u =>
|
.ToDictionary(u => u.Id, u => MapUserInfoViewModel(u, departmentDict, jobPositionDict));
|
||||||
{
|
|
||||||
var vm = ObjectMapper.Map<IdentityUser, UserInfoViewModel>(u);
|
|
||||||
vm.BirthDate = u.GetBirthDate();
|
|
||||||
vm.WorkHour = u.GetWorkHour();
|
|
||||||
vm.Nationality = u.GetNationality();
|
|
||||||
|
|
||||||
var deptId = u.GetDepartmentId();
|
|
||||||
if (deptId != Guid.Empty && departmentDict.TryGetValue(deptId, out var deptName))
|
|
||||||
{
|
|
||||||
vm.DepartmentId = deptId;
|
|
||||||
vm.Departments =
|
|
||||||
[
|
|
||||||
new AssignedDepartmentViewModel { Id = deptId, Name = deptName, IsAssigned = true }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
var jobPosId = u.GetJobPositionId();
|
|
||||||
if (jobPosId != Guid.Empty && jobPositionDict.TryGetValue(jobPosId, out var jobPosition))
|
|
||||||
{
|
|
||||||
vm.JobPositionId = jobPosId;
|
|
||||||
vm.JobPositions =
|
|
||||||
[
|
|
||||||
new AssignedJobPoisitionViewModel { Id = jobPosId, Name = jobPosition.Name, DepartmentId = jobPosition.DepartmentId, IsAssigned = true }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return vm;
|
|
||||||
});
|
|
||||||
|
|
||||||
foreach (var dto in dtos)
|
foreach (var dto in dtos)
|
||||||
{
|
{
|
||||||
|
|
@ -560,7 +547,10 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
{
|
{
|
||||||
var user = await _identityUserRepository.FindAsync(CurrentUser.Id.Value);
|
var user = await _identityUserRepository.FindAsync(CurrentUser.Id.Value);
|
||||||
if (user != null)
|
if (user != null)
|
||||||
dto.User = ObjectMapper.Map<IdentityUser, UserInfoViewModel>(user);
|
{
|
||||||
|
var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync();
|
||||||
|
dto.User = MapUserInfoViewModel(user, departmentDict, jobPositionDict);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await EnrichPollOptionsAsync([dto]);
|
await EnrichPollOptionsAsync([dto]);
|
||||||
|
|
@ -623,28 +613,11 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
|
|
||||||
if (userIds.Count > 0)
|
if (userIds.Count > 0)
|
||||||
{
|
{
|
||||||
var allDepartments = await _departmentRepository.GetListAsync();
|
var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync();
|
||||||
var departmentDict = allDepartments.ToDictionary(d => d.Id, d => d.Name);
|
|
||||||
var allJobPositions = await _jobPositionRepository.GetListAsync();
|
|
||||||
var jobPositionDict = allJobPositions.ToDictionary(j => j.Id, j => j);
|
|
||||||
var users = await _identityUserRepository.GetListAsync();
|
var users = await _identityUserRepository.GetListAsync();
|
||||||
var userMap = users.Where(u => userIds.Contains(u.Id)).ToDictionary(u => u.Id, u =>
|
var userMap = users
|
||||||
{
|
.Where(u => userIds.Contains(u.Id))
|
||||||
var vm = ObjectMapper.Map<IdentityUser, UserInfoViewModel>(u);
|
.ToDictionary(u => u.Id, u => MapUserInfoViewModel(u, departmentDict, jobPositionDict));
|
||||||
var deptId = u.GetDepartmentId();
|
|
||||||
if (deptId != Guid.Empty && departmentDict.TryGetValue(deptId, out var deptName))
|
|
||||||
{
|
|
||||||
vm.DepartmentId = deptId;
|
|
||||||
vm.Departments = [new AssignedDepartmentViewModel { Id = deptId, Name = deptName, IsAssigned = true }];
|
|
||||||
}
|
|
||||||
var jobPosId = u.GetJobPositionId();
|
|
||||||
if (jobPosId != Guid.Empty && jobPositionDict.TryGetValue(jobPosId, out var jobPosition))
|
|
||||||
{
|
|
||||||
vm.JobPositionId = jobPosId;
|
|
||||||
vm.JobPositions = [new AssignedJobPoisitionViewModel { Id = jobPosId, Name = jobPosition.Name, DepartmentId = jobPosition.DepartmentId, IsAssigned = true }];
|
|
||||||
}
|
|
||||||
return vm;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (dto.UserId.HasValue && userMap.TryGetValue(dto.UserId.Value, out var postUser))
|
if (dto.UserId.HasValue && userMap.TryGetValue(dto.UserId.Value, out var postUser))
|
||||||
dto.User = postUser;
|
dto.User = postUser;
|
||||||
|
|
@ -681,7 +654,10 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
||||||
{
|
{
|
||||||
var user = await _identityUserRepository.FindAsync(CurrentUser.Id.Value);
|
var user = await _identityUserRepository.FindAsync(CurrentUser.Id.Value);
|
||||||
if (user != null)
|
if (user != null)
|
||||||
dto.User = ObjectMapper.Map<IdentityUser, UserInfoViewModel>(user);
|
{
|
||||||
|
var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync();
|
||||||
|
dto.User = MapUserInfoViewModel(user, departmentDict, jobPositionDict);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
|
|
|
||||||
|
|
@ -4162,7 +4162,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Event)),
|
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Event)),
|
||||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||||
PagerOptionJson = DefaultPagerOptionJson,
|
PagerOptionJson = DefaultPagerOptionJson,
|
||||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 750, 400, true, true, true, true, false),
|
EditingOptionJson = DefaultEditingOptionJson(listFormName, 750, 500, true, true, true, true, false),
|
||||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||||
{
|
{
|
||||||
new() {
|
new() {
|
||||||
|
|
@ -4170,18 +4170,17 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "CategoryId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
new EditingFormItemDto { Order = 1, DataField = "CategoryId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||||
new EditingFormItemDto { Order = 2, DataField = "TypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "TypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 3, DataField = "Date", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Place", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 5, DataField = "UserId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
new EditingFormItemDto { Order = 5, DataField = "Place", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 7, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
new EditingFormItemDto { Order = 6, DataField = "UserId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||||
new EditingFormItemDto { Order = 6, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea },
|
new EditingFormItemDto { Order = 7, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea },
|
||||||
new EditingFormItemDto { Order = 8, DataField = "ParticipantsCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order = 8, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||||
new EditingFormItemDto { Order = 9, DataField = "Likes", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox },
|
|
||||||
]}
|
]}
|
||||||
}),
|
}),
|
||||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(),
|
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(),
|
||||||
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||||
new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Aktif", CustomValueType = FieldCustomValueTypeEnum.Value },
|
new() { FieldName = "Status", FieldDbType = DbType.String, Value = "draft", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -4243,6 +4242,24 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
PivotSettingsJson = DefaultPivotSettingsJson
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
},
|
},
|
||||||
|
//Date
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
ListFormCode = listForm.ListFormCode,
|
||||||
|
CultureName = LanguageCodes.En,
|
||||||
|
SourceDbType = DbType.Date,
|
||||||
|
FieldName = "Date",
|
||||||
|
CaptionName = "App.Listform.ListformField.Date",
|
||||||
|
Width = 100,
|
||||||
|
ListOrderNo = 4,
|
||||||
|
Visible = true,
|
||||||
|
IsActive = true,
|
||||||
|
AllowSearch = true,
|
||||||
|
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||||
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||||
|
PivotSettingsJson = DefaultPivotSettingsJson
|
||||||
|
},
|
||||||
// Name
|
// Name
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
@ -4252,7 +4269,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
FieldName = "Name",
|
FieldName = "Name",
|
||||||
CaptionName = "App.Listform.ListformField.Name",
|
CaptionName = "App.Listform.ListformField.Name",
|
||||||
Width = 200,
|
Width = 200,
|
||||||
ListOrderNo = 4,
|
ListOrderNo = 5,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
SortIndex = 1,
|
SortIndex = 1,
|
||||||
|
|
@ -4272,7 +4289,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
FieldName = "Place",
|
FieldName = "Place",
|
||||||
CaptionName = "App.Listform.ListformField.Place",
|
CaptionName = "App.Listform.ListformField.Place",
|
||||||
Width = 200,
|
Width = 200,
|
||||||
ListOrderNo = 5,
|
ListOrderNo = 6,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
|
@ -4288,7 +4305,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
FieldName = "Description",
|
FieldName = "Description",
|
||||||
CaptionName = "App.Listform.ListformField.Description",
|
CaptionName = "App.Listform.ListformField.Description",
|
||||||
Width = 500,
|
Width = 500,
|
||||||
ListOrderNo = 6,
|
ListOrderNo = 7,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
|
@ -4304,7 +4321,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
FieldName = "UserId",
|
FieldName = "UserId",
|
||||||
CaptionName = "App.Listform.ListformField.UserId",
|
CaptionName = "App.Listform.ListformField.UserId",
|
||||||
Width = 150,
|
Width = 150,
|
||||||
ListOrderNo = 7,
|
ListOrderNo = 8,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
||||||
|
|
@ -4326,7 +4343,8 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
FieldName = "ParticipantsCount",
|
FieldName = "ParticipantsCount",
|
||||||
CaptionName = "App.Listform.ListformField.ParticipantsCount",
|
CaptionName = "App.Listform.ListformField.ParticipantsCount",
|
||||||
Width = 80,
|
Width = 80,
|
||||||
ListOrderNo = 8,
|
Alignment = "right",
|
||||||
|
ListOrderNo = 9,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
|
@ -4342,7 +4360,8 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
FieldName = "Likes",
|
FieldName = "Likes",
|
||||||
CaptionName = "App.Listform.ListformField.Likes",
|
CaptionName = "App.Listform.ListformField.Likes",
|
||||||
Width = 80,
|
Width = 80,
|
||||||
ListOrderNo = 9,
|
Alignment = "right",
|
||||||
|
ListOrderNo = 10,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
|
@ -4358,7 +4377,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
FieldName = "Status",
|
FieldName = "Status",
|
||||||
CaptionName = "App.Listform.ListformField.Status",
|
CaptionName = "App.Listform.ListformField.Status",
|
||||||
Width = 120,
|
Width = 120,
|
||||||
ListOrderNo = 10,
|
ListOrderNo = 11,
|
||||||
Visible = true,
|
Visible = true,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
||||||
|
|
@ -4366,9 +4385,9 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
DisplayExpr = "name",
|
DisplayExpr = "name",
|
||||||
ValueExpr = "key",
|
ValueExpr = "key",
|
||||||
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
|
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
|
||||||
new () { Key="Published",Name="Yayımlandı" },
|
new () { Key="published",Name="Yayımlandı" },
|
||||||
new () { Key="Draft",Name="Taslak" },
|
new () { Key="draft",Name="Taslak" },
|
||||||
new () { Key="Cancelled",Name="İptal" },
|
new () { Key="cancelled",Name="İptal" },
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Volo.Abp.Domain.Entities.Auditing;
|
using Volo.Abp.Domain.Entities.Auditing;
|
||||||
using Volo.Abp.MultiTenancy;
|
using Volo.Abp.MultiTenancy;
|
||||||
|
|
||||||
|
|
@ -27,10 +26,6 @@ public class Event : FullAuditedEntity<Guid>, IMultiTenant
|
||||||
public int Likes { get; set; }
|
public int Likes { get; set; }
|
||||||
public bool isPublished { get; set; } = false;
|
public bool isPublished { get; set; } = false;
|
||||||
|
|
||||||
// public ICollection<Employee> Participants { get; set; } = [];
|
|
||||||
public ICollection<EventPhoto> Photos { get; set; } = [];
|
|
||||||
public ICollection<EventComment> Comments { get; set; } = [];
|
|
||||||
|
|
||||||
Guid? IMultiTenant.TenantId => TenantId;
|
Guid? IMultiTenant.TenantId => TenantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
using System;
|
|
||||||
using Volo.Abp.Domain.Entities.Auditing;
|
|
||||||
using Volo.Abp.MultiTenancy;
|
|
||||||
|
|
||||||
namespace Sozsoft.Platform.Entities;
|
|
||||||
|
|
||||||
public class EventComment : FullAuditedEntity<Guid>, IMultiTenant
|
|
||||||
{
|
|
||||||
public Guid? TenantId { get; set; }
|
|
||||||
|
|
||||||
public Guid EventId { get; set; }
|
|
||||||
public Guid? UserId { get; set; }
|
|
||||||
public string Content { get; set; }
|
|
||||||
public int Likes { get; set; }
|
|
||||||
|
|
||||||
public Event Event { get; set; }
|
|
||||||
|
|
||||||
Guid? IMultiTenant.TenantId => TenantId;
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
using System;
|
|
||||||
using Volo.Abp.Domain.Entities.Auditing;
|
|
||||||
using Volo.Abp.MultiTenancy;
|
|
||||||
|
|
||||||
namespace Sozsoft.Platform.Entities;
|
|
||||||
|
|
||||||
public class EventPhoto : FullAuditedEntity<Guid>, IMultiTenant
|
|
||||||
{
|
|
||||||
public Guid? TenantId { get; set; }
|
|
||||||
|
|
||||||
public Guid EventId { get; set; }
|
|
||||||
public string Url { get; set; }
|
|
||||||
|
|
||||||
public Event Event { get; set; }
|
|
||||||
|
|
||||||
Guid? IMultiTenant.TenantId => TenantId;
|
|
||||||
}
|
|
||||||
|
|
@ -113,8 +113,6 @@ public class PlatformDbContext :
|
||||||
public DbSet<Event> Events { get; set; }
|
public DbSet<Event> Events { get; set; }
|
||||||
public DbSet<EventCategory> EventCategories { get; set; }
|
public DbSet<EventCategory> EventCategories { get; set; }
|
||||||
public DbSet<EventType> EventTypes { get; set; }
|
public DbSet<EventType> EventTypes { get; set; }
|
||||||
public DbSet<EventPhoto> EventPhotos { get; set; }
|
|
||||||
public DbSet<EventComment> EventComments { get; set; }
|
|
||||||
|
|
||||||
public DbSet<Announcement> Announcements { get; set; }
|
public DbSet<Announcement> Announcements { get; set; }
|
||||||
|
|
||||||
|
|
@ -1251,34 +1249,5 @@ public class PlatformDbContext :
|
||||||
.HasForeignKey(x => x.TypeId)
|
.HasForeignKey(x => x.TypeId)
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.Entity<EventPhoto>(b =>
|
|
||||||
{
|
|
||||||
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventPhoto)), Prefix.DbSchema);
|
|
||||||
b.ConfigureByConvention();
|
|
||||||
|
|
||||||
b.Property(x => x.Url).HasMaxLength(512);
|
|
||||||
|
|
||||||
// Event -> EventPhoto (1 - N)
|
|
||||||
b.HasOne(x => x.Event)
|
|
||||||
.WithMany(x => x.Photos)
|
|
||||||
.HasForeignKey(x => x.EventId)
|
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
builder.Entity<EventComment>(b =>
|
|
||||||
{
|
|
||||||
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventComment)), Prefix.DbSchema);
|
|
||||||
b.ConfigureByConvention();
|
|
||||||
|
|
||||||
b.Property(x => x.Content).HasMaxLength(512);
|
|
||||||
b.Property(x => x.Likes).HasDefaultValue(0);
|
|
||||||
|
|
||||||
// Event -> EventComment (1 - N)
|
|
||||||
b.HasOne(x => x.Event)
|
|
||||||
.WithMany(x => x.Comments)
|
|
||||||
.HasForeignKey(x => x.EventId)
|
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1857,45 +1857,45 @@
|
||||||
{
|
{
|
||||||
"CategoryName": "Spor",
|
"CategoryName": "Spor",
|
||||||
"TypeName": "Futbol Turnuvası",
|
"TypeName": "Futbol Turnuvası",
|
||||||
"Date": "2025-11-05T10:00:00",
|
"Date": "2026-11-05T10:00:00",
|
||||||
"Name": "Yaz Futbol Turnuvası 2025",
|
"Name": "Yaz Futbol Turnuvası 2026",
|
||||||
"Description": "Tüm departmanların katılımıyla düzenlenen geleneksel yaz futbol turnuvası.",
|
"Description": "Tüm departmanların katılımıyla düzenlenen geleneksel yaz futbol turnuvası.",
|
||||||
"Place": "Şirket Kampüsü Spor Alanı",
|
"Place": "Şirket Kampüsü Spor Alanı",
|
||||||
"Status": "Published",
|
"Status": "published",
|
||||||
"UserName": "system@sozsoft.com",
|
"UserName": "system@sozsoft.com",
|
||||||
"ParticipantsCount": 64,
|
"ParticipantsCount": 64,
|
||||||
"IsPublished": true,
|
"IsPublished": true,
|
||||||
"Likes": 120,
|
"Likes": 0,
|
||||||
"Photos": [],
|
"Photos": [],
|
||||||
"Comments": []
|
"Comments": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"CategoryName": "Kültür",
|
"CategoryName": "Kültür",
|
||||||
"TypeName": "Kültürel Sanat Günü",
|
"TypeName": "Kültürel Sanat Günü",
|
||||||
"Date": "2025-11-01T10:00:00",
|
"Date": "2026-11-01T10:00:00",
|
||||||
"Name": "Kültür Gezisi: Kapadokya",
|
"Name": "Kültür Gezisi: Kapadokya",
|
||||||
"Description": "Çalışanlarımıza özel, rehber eşliğinde 2 günlük kültürel gezi.",
|
"Description": "Çalışanlarımıza özel, rehber eşliğinde 2 günlük kültürel gezi.",
|
||||||
"Place": "Kapadokya, Nevşehir",
|
"Place": "Kapadokya, Nevşehir",
|
||||||
"Status": "Published",
|
"Status": "published",
|
||||||
"UserName": "system@sozsoft.com",
|
"UserName": "system@sozsoft.com",
|
||||||
"ParticipantsCount": 25,
|
"ParticipantsCount": 25,
|
||||||
"IsPublished": true,
|
"IsPublished": true,
|
||||||
"Likes": 45,
|
"Likes": 0,
|
||||||
"Photos": [],
|
"Photos": [],
|
||||||
"Comments": []
|
"Comments": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"CategoryName": "Müzik",
|
"CategoryName": "Müzik",
|
||||||
"TypeName": "Caz Akşamı",
|
"TypeName": "Caz Akşamı",
|
||||||
"Date": "2025-11-09T10:00:00",
|
"Date": "2026-11-09T10:00:00",
|
||||||
"Name": "Müzik Dinletisi: Jazz Akşamı",
|
"Name": "Müzik Dinletisi: Jazz Akşamı",
|
||||||
"Description": "Caz müziğinin en güzel örneklerinin canlı performanslarla sunulacağı özel akşam.",
|
"Description": "Caz müziğinin en güzel örneklerinin canlı performanslarla sunulacağı özel akşam.",
|
||||||
"Place": "Şirket Konferans Salonu",
|
"Place": "Şirket Konferans Salonu",
|
||||||
"Status": "Published",
|
"Status": "published",
|
||||||
"UserName": "system@sozsoft.com",
|
"UserName": "system@sozsoft.com",
|
||||||
"ParticipantsCount": 40,
|
"ParticipantsCount": 40,
|
||||||
"IsPublished": true,
|
"IsPublished": true,
|
||||||
"Likes": 85,
|
"Likes": 0,
|
||||||
"Photos": [],
|
"Photos": [],
|
||||||
"Comments": []
|
"Comments": []
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -459,8 +459,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
private readonly IRepository<EventType, Guid> _eventTypeRepository;
|
private readonly IRepository<EventType, Guid> _eventTypeRepository;
|
||||||
private readonly IRepository<EventCategory, Guid> _eventCategoryRepository;
|
private readonly IRepository<EventCategory, Guid> _eventCategoryRepository;
|
||||||
private readonly IRepository<Event, Guid> _eventRepository;
|
private readonly IRepository<Event, Guid> _eventRepository;
|
||||||
private readonly IRepository<EventComment, Guid> _eventCommentRepository;
|
|
||||||
private readonly IRepository<EventPhoto, Guid> _eventPhotoRepository;
|
|
||||||
|
|
||||||
private readonly ICurrentTenant _currentTenant;
|
private readonly ICurrentTenant _currentTenant;
|
||||||
|
|
||||||
|
|
@ -507,8 +505,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
IRepository<EventType, Guid> eventTypeRepository,
|
IRepository<EventType, Guid> eventTypeRepository,
|
||||||
IRepository<EventCategory, Guid> eventCategoryRepository,
|
IRepository<EventCategory, Guid> eventCategoryRepository,
|
||||||
IRepository<Event, Guid> eventRepository,
|
IRepository<Event, Guid> eventRepository,
|
||||||
IRepository<EventPhoto, Guid> eventPhotoRepository,
|
|
||||||
IRepository<EventComment, Guid> eventCommentRepository,
|
|
||||||
|
|
||||||
OrganizationUnitManager organizationUnitManager,
|
OrganizationUnitManager organizationUnitManager,
|
||||||
ICurrentTenant currentTenant
|
ICurrentTenant currentTenant
|
||||||
|
|
@ -555,8 +551,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
_eventTypeRepository = eventTypeRepository;
|
_eventTypeRepository = eventTypeRepository;
|
||||||
_eventCategoryRepository = eventCategoryRepository;
|
_eventCategoryRepository = eventCategoryRepository;
|
||||||
_eventRepository = eventRepository;
|
_eventRepository = eventRepository;
|
||||||
_eventCommentRepository = eventCommentRepository;
|
|
||||||
_eventPhotoRepository = eventPhotoRepository;
|
|
||||||
_organizationUnitManager = organizationUnitManager;
|
_organizationUnitManager = organizationUnitManager;
|
||||||
_currentTenant = currentTenant;
|
_currentTenant = currentTenant;
|
||||||
}
|
}
|
||||||
|
|
@ -1226,43 +1220,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in items.EventPhotos)
|
|
||||||
{
|
|
||||||
var exists = await _eventPhotoRepository.AnyAsync(x => x.Url == item.Url);
|
|
||||||
if (!exists)
|
|
||||||
{
|
|
||||||
var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.EventName);
|
|
||||||
|
|
||||||
await _eventPhotoRepository.InsertAsync(new EventPhoto
|
|
||||||
{
|
|
||||||
EventId = eventEntity.Id,
|
|
||||||
Url = item.Url
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in items.EventComments)
|
|
||||||
{
|
|
||||||
var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.EventName);
|
|
||||||
|
|
||||||
if (eventEntity == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var exists = await _eventCommentRepository.AnyAsync(x => x.Content == item.Content);
|
|
||||||
if (!exists)
|
|
||||||
{
|
|
||||||
var user = await _repositoryUser.FindByNormalizedUserNameAsync(item.UserName);
|
|
||||||
|
|
||||||
await _eventCommentRepository.InsertAsync(new EventComment
|
|
||||||
{
|
|
||||||
EventId = eventEntity.Id,
|
|
||||||
Content = item.Content,
|
|
||||||
UserId = user != null ? user.Id : null,
|
|
||||||
Likes = item.Likes
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//admin kullanının departmen ve pozisyonunu default olarak belirliyoruz
|
//admin kullanının departmen ve pozisyonunu default olarak belirliyoruz
|
||||||
var adminUser = await _repositoryUser.FindByNormalizedEmailAsync(PlatformConsts.AbpIdentity.User.AdminEmailDefaultValue);
|
var adminUser = await _repositoryUser.FindByNormalizedEmailAsync(PlatformConsts.AbpIdentity.User.AdminEmailDefaultValue);
|
||||||
if (adminUser != null)
|
if (adminUser != null)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,28 @@
|
||||||
{
|
{
|
||||||
"commit": "ea3e847",
|
"commit": "ab656ba",
|
||||||
"releases": [
|
"releases": [
|
||||||
|
{
|
||||||
|
"version": "1.0.7",
|
||||||
|
"buildDate": "2026-05-04",
|
||||||
|
"commit": "4444fce93b4f62ad6698099fefe7da1614d2859c",
|
||||||
|
"changeLog": [
|
||||||
|
"- Departman tanımlama",
|
||||||
|
"- Job Position tanımlama",
|
||||||
|
"- Wizard ve SQl Data güncellemeleri",
|
||||||
|
"- Organizasyon Şemanı eklendi"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "1.0.6",
|
||||||
|
"buildDate": "2026-05-03",
|
||||||
|
"commit": "b2dfb04879a93709b04f8f0fc3bd4f5af1f7c01b",
|
||||||
|
"changeLog": [
|
||||||
|
"- SalesOrder ve SalesOrderItem listFormu tanımlandı.",
|
||||||
|
"- Sql Backup dosyalarını File Manager içerisinde görüntülenebiliyor.",
|
||||||
|
"- Wizard File Manager komponenti oluşturuldu.",
|
||||||
|
"- Wizard komponentini Edit özelliği eklendi."
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"buildDate": "2026-04-28",
|
"buildDate": "2026-04-28",
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export interface IntranetDashboardDto {
|
||||||
|
|
||||||
// Etkinlik
|
// Etkinlik
|
||||||
export interface EventDto {
|
export interface EventDto {
|
||||||
|
tenantId?: string | null
|
||||||
id: string
|
id: string
|
||||||
categoryName: string
|
categoryName: string
|
||||||
typeName: string
|
typeName: string
|
||||||
|
|
@ -18,12 +19,12 @@ export interface EventDto {
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
place: string
|
place: string
|
||||||
organizer: UserInfoViewModel
|
user: UserInfoViewModel
|
||||||
participants: number
|
participantsCount: number
|
||||||
photos: string[]
|
|
||||||
comments: EventCommentDto[]
|
|
||||||
likes: number
|
likes: number
|
||||||
isPublished: boolean
|
isPublished: boolean
|
||||||
|
photos: string[]
|
||||||
|
comments: EventCommentDto[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventCommentDto {
|
export interface EventCommentDto {
|
||||||
|
|
|
||||||
|
|
@ -10,27 +10,6 @@ type EventProps = {
|
||||||
compact?: boolean
|
compact?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const ticketStatus: Record<
|
|
||||||
number,
|
|
||||||
{
|
|
||||||
label: string
|
|
||||||
bgClass: string
|
|
||||||
textClass: string
|
|
||||||
}
|
|
||||||
> = {
|
|
||||||
0: {
|
|
||||||
label: 'Completed',
|
|
||||||
bgClass: 'bg-emerald-500',
|
|
||||||
textClass: 'text-emerald-500',
|
|
||||||
},
|
|
||||||
1: { label: 'In Dev', bgClass: 'bg-blue-500', textClass: 'text-blue-500' },
|
|
||||||
2: {
|
|
||||||
label: 'Ready to test',
|
|
||||||
bgClass: 'bg-amber-500',
|
|
||||||
textClass: 'text-amber-500',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const HighlightedText = ({ children, className }: CommonProps) => {
|
const HighlightedText = ({ children, className }: CommonProps) => {
|
||||||
return (
|
return (
|
||||||
<span className={classNames('font-semibold text-gray-900 dark:text-gray-100', className)}>
|
<span className={classNames('font-semibold text-gray-900 dark:text-gray-100', className)}>
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,12 @@ import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
|
|
||||||
const UpcomingEvents: React.FC<{ events: EventDto[] }> = ({ events }) => {
|
const UpcomingEvents: React.FC<{ events: EventDto[] }> = ({ events }) => {
|
||||||
const currentLocale = useLocale()
|
const currentLocale = useLocale()
|
||||||
const { translate } = useLocalization();
|
const { translate } = useLocalization()
|
||||||
|
|
||||||
const upcomingEvents = events.filter(
|
const now = dayjs()
|
||||||
(event) =>
|
const upcomingEvents = events
|
||||||
event.isPublished &&
|
.filter((event) => event.isPublished && !dayjs(event.date).isBefore(now, 'day'))
|
||||||
dayjs(event.date).isAfter(dayjs()) &&
|
.sort((left, right) => dayjs(left.date).valueOf() - dayjs(right.date).valueOf())
|
||||||
dayjs(event.date).isBefore(dayjs().add(7, 'day')),
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
<div className="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@
|
||||||
"allowJs": false,
|
"allowJs": false,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": false,
|
"esModuleInterop": false,
|
||||||
|
"ignoreDeprecations": "6.0",
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"forceConsistentCasingInFileNames": false,
|
"forceConsistentCasingInFileNames": false,
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "Bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
|
|
@ -23,21 +24,3 @@
|
||||||
"exclude": ["node_modules"],
|
"exclude": ["node_modules"],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
}
|
}
|
||||||
|
|
||||||
// {
|
|
||||||
// "compilerOptions": {
|
|
||||||
// /* Bundler mode */
|
|
||||||
// "moduleResolution": "bundler",
|
|
||||||
// "allowImportingTsExtensions": true,
|
|
||||||
// "resolveJsonModule": true,
|
|
||||||
// "isolatedModules": true,
|
|
||||||
// "noEmit": true,
|
|
||||||
// "jsx": "react-jsx",
|
|
||||||
|
|
||||||
// /* Linting */
|
|
||||||
// "strict": true,
|
|
||||||
// "noUnusedLocals": true,
|
|
||||||
// "noUnusedParameters": true,
|
|
||||||
// "noFallthroughCasesInSwitch": true
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "Bundler",
|
||||||
|
"ignoreDeprecations": "6.0",
|
||||||
"allowSyntheticDefaultImports": true
|
"allowSyntheticDefaultImports": true
|
||||||
},
|
},
|
||||||
"include": ["vite.config.ts", "./src/services/tenants.ts"]
|
"include": ["vite.config.ts", "./src/services/tenants.ts"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue