TaskAndTicket - Fine, reward.... - SubAccountRoll Create And edit - HeaderAndFooter
This commit is contained in:
@@ -16,9 +16,9 @@ using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
using TaskManager.Domain.PositionAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using System.Security.Claims;
|
||||
using AccountManagement.Domain.PositionAgg;
|
||||
using AccountManagement.Domain.SubAccountAgg;
|
||||
using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg;
|
||||
using AccountManagement.Domain.SubAccountRoleAgg;
|
||||
|
||||
@@ -4,7 +4,7 @@ using AccountManagement.Application.Contracts.Account;
|
||||
using AccountManagement.Application.Contracts.Position;
|
||||
using AccountManagement.Domain.AccountAgg;
|
||||
using AccountManagement.Domain.AssignAgg;
|
||||
using TaskManager.Domain.PositionAgg;
|
||||
using AccountManagement.Domain.PositionAgg;
|
||||
|
||||
namespace TaskManager.Application;
|
||||
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.OleDb;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using AccountManagement.Application.Contracts.Assign;
|
||||
using AccountManagement.Application.Contracts.Task;
|
||||
using AccountManagement.Application.Contracts.TaskMessage;
|
||||
using AccountManagement.Domain.AccountAgg;
|
||||
using AccountManagement.Domain.AdminResponseAgg;
|
||||
using AccountManagement.Domain.AssignAgg;
|
||||
using AccountManagement.Domain.MediaAgg;
|
||||
using AccountManagement.Domain.PositionAgg;
|
||||
using AccountManagement.Domain.TaskAgg;
|
||||
using IPE.SmsIrClient.Models.Results;
|
||||
using TaskManager.Domain.PositionAgg;
|
||||
using System.Reflection;
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Globalization;
|
||||
using AccountManagement.Application.Contracts.TaskMessage;
|
||||
using AccountManagement.Domain.AdminResponseAgg;
|
||||
using AccountManagement.Domain.TaskMessageAgg;
|
||||
using AccountManagement.Domain.TicketAgg;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace AccountManagement.Application;
|
||||
@@ -33,7 +29,6 @@ public class TaskApplication : ITaskApplication
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly ITaskMessageRepository _taskMessageRepository;
|
||||
private readonly ITicketRepository _ticketRepository;
|
||||
|
||||
private readonly IAuthHelper _authHelper;
|
||||
|
||||
|
||||
@@ -358,7 +353,7 @@ public class TaskApplication : ITaskApplication
|
||||
{
|
||||
|
||||
}
|
||||
var endTask = string.IsNullOrWhiteSpace(command.EndTaskTime) || command.EndTaskTime == "00:00" ? command.EndTaskDate.ToGeorgianDateTime2() : command.EndTaskDate.ToGeorgianDateWithTime(command.EndTaskTime);
|
||||
var endTask = string.IsNullOrWhiteSpace(command.EndTaskTime) || command.EndTaskTime == "00:00" ? command.EndTaskDate.ToEndDayOfGeorgianDateTime() : command.EndTaskDate.ToGeorgianDateWithTime(command.EndTaskTime);
|
||||
|
||||
var errorDateTime = new DateTime(3000, 12, 20, new PersianCalendar());
|
||||
if (endTask == errorDateTime)
|
||||
@@ -372,15 +367,15 @@ public class TaskApplication : ITaskApplication
|
||||
}
|
||||
var task = new Tasks(command.Title, command.Description, command.SenderId, command.ContractingPartyName);
|
||||
_taskRepository.Create(task);
|
||||
if (command.TaskScheduleId>0)
|
||||
if (command.TaskScheduleId > 0)
|
||||
{
|
||||
task.SetTaskSchedule(command.TaskScheduleId);
|
||||
task.SetTaskSchedule(command.TaskScheduleId);
|
||||
}
|
||||
_assignRepository.SaveChanges();
|
||||
foreach (var receiver in receivers)
|
||||
{
|
||||
var assign = new Assign(task.id, task.SenderId, receiver.id, sender.Position.PositionValue, receiver.Fullname,
|
||||
receiver.Position.PositionValue, endTask,true);
|
||||
receiver.Position.PositionValue, endTask, true);
|
||||
_assignRepository.Create(assign);
|
||||
}
|
||||
|
||||
@@ -432,7 +427,7 @@ public class TaskApplication : ITaskApplication
|
||||
DateTime endTask;
|
||||
if (string.IsNullOrWhiteSpace(command.EndTaskTime))
|
||||
{
|
||||
endTask = command.EndTaskDate.ToGeorgianDateTime2();
|
||||
endTask = command.EndTaskDate.ToEndDayOfGeorgianDateTime();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -481,13 +476,7 @@ public class TaskApplication : ITaskApplication
|
||||
return _taskRepository.GetDetails(taskId);
|
||||
}
|
||||
|
||||
//لیست کامل تسک ها
|
||||
public List<TaskViewModel> GetTasks(TaskSearchModel searchModel)
|
||||
{
|
||||
var test = _taskRepository.GetTasks(searchModel);
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
public List<TaskViewModel> GetSelfTasks(TaskSearchModel searchModel)
|
||||
{
|
||||
@@ -574,6 +563,12 @@ public class TaskApplication : ITaskApplication
|
||||
_taskRepository.SaveChanges();
|
||||
return operation.Succcedded(task.id);
|
||||
}
|
||||
|
||||
public List<TaskViewModel> GetRequestTaskHasTicket(TaskSearchModel searchModel)
|
||||
{
|
||||
return _taskRepository.GetRequestTaskHasTicket(searchModel);
|
||||
}
|
||||
|
||||
//تایید درخواست مهلت
|
||||
public OperationResult AcceptRequestDatetime(long taskId, long assignedId, string message)
|
||||
{
|
||||
@@ -741,9 +736,9 @@ public class TaskApplication : ITaskApplication
|
||||
}
|
||||
var task = _taskRepository.GetIncludeAssign(command.TaskId);
|
||||
|
||||
if (task.SenderId ==accountId)
|
||||
if (task.SenderId == accountId)
|
||||
{
|
||||
command.Description=string.IsNullOrWhiteSpace(command.Description) ? "وظیفه محولشده توسط ارسال کننده به پایان رسیده است." :command.Description;
|
||||
command.Description = string.IsNullOrWhiteSpace(command.Description) ? "وظیفه محولشده توسط ارسال کننده به پایان رسیده است." : command.Description;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -870,6 +865,17 @@ public class TaskApplication : ITaskApplication
|
||||
return _taskRepository.AllRequestedTasks(searchModel);
|
||||
}
|
||||
|
||||
public int TasksHaveTicketCounts(long userId)
|
||||
{
|
||||
return _taskRepository.TasksHaveTicketCounts(userId);
|
||||
}
|
||||
|
||||
public int TasksHaveTicketRequestsCount(long userId)
|
||||
{
|
||||
return _taskRepository.TasksHaveTicketRequestsCount(userId);
|
||||
}
|
||||
|
||||
|
||||
public List<TaskMessageViewModel> GetTaskMessages(long assignId)
|
||||
{
|
||||
return _taskMessageRepository.GetTaskMessages(assignId);
|
||||
@@ -900,16 +906,13 @@ public class TaskApplication : ITaskApplication
|
||||
return operation.Failed("تاریخی برای درخواست وظیفه ثبت نشده است");
|
||||
}
|
||||
|
||||
DateTime timeGr = time.ToGeorgianDateTime2();
|
||||
DateTime timeGr = time.ToEndDayOfGeorgianDateTime();
|
||||
if (timeGr.IsInvalidDateTime())
|
||||
{
|
||||
return operation.Failed("لطفا تاریخ خود را به درستی وارد کنید");
|
||||
}
|
||||
|
||||
message = string.IsNullOrWhiteSpace(message) ? "درخواست شما مورد تایید قرار گرفت" : message;
|
||||
|
||||
assign.ChangeTimeTask(timeGr);
|
||||
|
||||
var messageEntity = new TaskMessage(message, "تایید و تغییر درخواست کنسل", assign.id);
|
||||
_taskMessageRepository.Create(messageEntity);
|
||||
_taskMessageRepository.SaveChanges();
|
||||
@@ -1009,6 +1012,7 @@ public class TaskApplication : ITaskApplication
|
||||
return _taskRepository.OverdueTasksCount(userId);
|
||||
|
||||
}
|
||||
|
||||
//public OperationResult MoveDataFRomTaskToAssign()
|
||||
//{
|
||||
// return _taskRepository.MoveDataFRomTaskToAssign();
|
||||
|
||||
@@ -94,8 +94,8 @@ public class TaskScheduleApplication : ITaskScheduleApplication
|
||||
}
|
||||
try
|
||||
{
|
||||
DateTime previousDateRaw = command.EndTaskDate.ToGeorgianDateTime2();
|
||||
DateTime previousDateEdited = command.EndTaskDate.ToGeorgianDateTime2();
|
||||
DateTime previousDateRaw = command.EndTaskDate.ToEndDayOfGeorgianDateTime();
|
||||
DateTime previousDateEdited = command.EndTaskDate.ToEndDayOfGeorgianDateTime();
|
||||
|
||||
int count = Convert.ToInt32(command.ScheduleCount);
|
||||
bool isInt = int.TryParse(command.ScheduleUnitNumber, out int unitNumber);
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Task;
|
||||
using AccountManagement.Application.Contracts.Ticket;
|
||||
using AccountManagement.Application.Contracts.TicketAccessAccount;
|
||||
@@ -14,12 +8,12 @@ using AccountManagement.Domain.AssignAgg;
|
||||
using AccountManagement.Domain.ClientResponseAgg;
|
||||
using AccountManagement.Domain.MediaAgg;
|
||||
using AccountManagement.Domain.TaskAgg;
|
||||
using AccountManagement.Domain.TicketAccessAccountAgg;
|
||||
using AccountManagement.Domain.TicketAgg;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using IPE.SmsIrClient.Models.Results;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace AccountManagement.Application;
|
||||
|
||||
@@ -68,7 +62,7 @@ public class TicketApplication : ITicketApplication
|
||||
var ticketNumber = (_ticketRepository.GetLastTicketNumber() + 1).ToString("D5");
|
||||
|
||||
var ticket = new Ticket(command.Title, command.Description, command.SenderId, command.ContractingPartyName,
|
||||
command.TicketType, command.WorkshopId, ticketNumber, command.SubAccountId);
|
||||
command.TicketType, command.WorkshopId, ticketNumber,command.SubAccountId);
|
||||
_ticketRepository.Create(ticket);
|
||||
_ticketRepository.SaveChanges();
|
||||
|
||||
@@ -203,7 +197,7 @@ public class TicketApplication : ITicketApplication
|
||||
|
||||
|
||||
|
||||
var endTask = string.IsNullOrWhiteSpace(command.EndTaskTime) ? command.EndTaskDate.ToGeorgianDateTime2() : command.EndTaskDate.ToGeorgianDateWithTime(command.EndTaskTime);
|
||||
var endTask = string.IsNullOrWhiteSpace(command.EndTaskTime) ? command.EndTaskDate.ToEndDayOfGeorgianDateTime() : command.EndTaskDate.ToGeorgianDateWithTime(command.EndTaskTime);
|
||||
|
||||
var task = new Tasks(command.Title, command.Description, command.SenderId, command.ContractingPartyName, ticketId);
|
||||
_taskRepository.Create(task);
|
||||
@@ -214,7 +208,7 @@ public class TicketApplication : ITicketApplication
|
||||
foreach (var receiver in receivers)
|
||||
{
|
||||
var assign = new Assign(task.id, task.SenderId, receiver.id, sender.Position.PositionValue, receiver.Fullname,
|
||||
receiver.Position.PositionValue, endTask,true);
|
||||
receiver.Position.PositionValue, endTask, true);
|
||||
_assignRepository.Create(assign);
|
||||
}
|
||||
_assignRepository.SaveChanges();
|
||||
@@ -305,10 +299,10 @@ public class TicketApplication : ITicketApplication
|
||||
if (_ticketAccessAccountApplication.HasTicketAccess(command.AdminId))
|
||||
adminRes.Active();
|
||||
var ticket = _ticketRepository.Get(command.TicketId);
|
||||
_ticketRepository.CreateAdminResponse(adminRes);
|
||||
ticket.Responded();
|
||||
_ticketRepository.SaveChanges();
|
||||
|
||||
_ticketRepository.CreateAdminResponse(adminRes);
|
||||
ticket.Responded();
|
||||
_ticketRepository.SaveChanges();
|
||||
|
||||
|
||||
#region SaveDocuments
|
||||
|
||||
@@ -376,7 +370,7 @@ public class TicketApplication : ITicketApplication
|
||||
var ticket = _ticketRepository.Get(command.TicketId);
|
||||
_ticketRepository.CreateClientResponse(clientRes);
|
||||
ticket.Open();
|
||||
_ticketRepository.SaveChanges();
|
||||
_ticketRepository.SaveChanges();
|
||||
#region SaveDocuments
|
||||
|
||||
if (command.UploadedFileIds?.Count > 0)
|
||||
@@ -440,6 +434,11 @@ public class TicketApplication : ITicketApplication
|
||||
return _ticketRepository.GetAll(searchModel);
|
||||
}
|
||||
|
||||
public List<TicketViewModel> GetDeletedTicket()
|
||||
{
|
||||
return _ticketRepository.GetDeletedTicket();
|
||||
}
|
||||
|
||||
public bool IsExist(long id)
|
||||
{
|
||||
return _ticketRepository.Exists(x => x.id == id);
|
||||
@@ -516,7 +515,7 @@ public class TicketApplication : ITicketApplication
|
||||
var ticket = _ticketRepository.Get(adminRes.TicketId);
|
||||
|
||||
|
||||
if (adminRes.IsActiveString == "true")
|
||||
if (adminRes.IsActiveString == "true")
|
||||
{
|
||||
return operation.Failed("خطایی رخ داده است . لطفا با مدیر سیستم تماس بگیرید");
|
||||
}
|
||||
@@ -545,7 +544,7 @@ public class TicketApplication : ITicketApplication
|
||||
var operation = new OperationResult();
|
||||
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
|
||||
var ticket = _ticketRepository.Get(adminRes.TicketId);
|
||||
if (adminRes.IsActiveString == "true")
|
||||
if (adminRes.IsActiveString == "true")
|
||||
{
|
||||
return operation.Failed("خطایی رخ داده است . لطفا با مدیر سیستم تماس بگیرید");
|
||||
}
|
||||
@@ -563,11 +562,11 @@ public class TicketApplication : ITicketApplication
|
||||
try
|
||||
{
|
||||
var adminRes = _ticketRepository.GetAdminResponse(adminResId);
|
||||
if (adminRes.AdminAccountId!=userId)
|
||||
if (adminRes.AdminAccountId != userId)
|
||||
{
|
||||
return operation.Failed("شما نمیتوانید این پیام را پاک کنید");
|
||||
}
|
||||
if (adminRes.IsActiveString=="true")
|
||||
if (adminRes.IsActiveString == "true")
|
||||
{
|
||||
return operation.Failed("شما نمیتوانید این پیام را پاک کنید");
|
||||
}
|
||||
@@ -581,11 +580,11 @@ public class TicketApplication : ITicketApplication
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResult EditPendingAdminResponse(long adminResId,string newMessage)
|
||||
public OperationResult EditPendingAdminResponse(long adminResId, string newMessage)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var entity=_ticketRepository.GetAdminResponse(adminResId);
|
||||
if (entity==null)
|
||||
var entity = _ticketRepository.GetAdminResponse(adminResId);
|
||||
if (entity == null)
|
||||
{
|
||||
return operation.Failed("مشکل سیستمی!!");
|
||||
}
|
||||
@@ -596,26 +595,49 @@ public class TicketApplication : ITicketApplication
|
||||
|
||||
public OperationResult CloseTicket(long ticketId)
|
||||
{
|
||||
var operation= new OperationResult();
|
||||
var ticket = _ticketRepository.Get(ticketId);
|
||||
if (ticket == null)
|
||||
{
|
||||
return operation.Failed("اطلاعات وارد شده نامعتبر است");
|
||||
}
|
||||
var operation = new OperationResult();
|
||||
var ticket = _ticketRepository.Get(ticketId);
|
||||
if (ticket == null)
|
||||
{
|
||||
return operation.Failed("اطلاعات وارد شده نامعتبر است");
|
||||
}
|
||||
ticket.Completed();
|
||||
_ticketRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult DeleteTicket(long ticketId)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var ticket = _ticketRepository.Get(ticketId);
|
||||
if (ticket == null)
|
||||
return op.Failed("چنین آیتمی وجود ندارد");
|
||||
ticket.Delete();
|
||||
_ticketRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult RestoreDeletedTicket(long ticketId)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var ticket = _ticketRepository.Get(ticketId);
|
||||
if (ticket == null)
|
||||
return op.Failed("چنین آیتمی وجود ندارد");
|
||||
ticket.RestoreDelete ();
|
||||
_ticketRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public TypesCountOfTicketViewModel GetTypesCountOfTicketForAdmin()
|
||||
{
|
||||
return _ticketRepository.GetTypesCountOfTicketForAdmin();
|
||||
return _ticketRepository.GetTypesCountOfTicketForAdmin();
|
||||
}
|
||||
|
||||
public TypesCountOfTicketViewModel GetTypesCountOfTicketForClient(long workshopId)
|
||||
{
|
||||
return _ticketRepository.GetTypesCountOfTicketForClient(workshopId);
|
||||
return _ticketRepository.GetTypesCountOfTicketForClient(workshopId);
|
||||
}
|
||||
|
||||
#region Vafa
|
||||
|
||||
public int GetAdminTicketsCount()
|
||||
|
||||
Reference in New Issue
Block a user