Compare commits
3 Commits
AdminCheck
...
Feature/In
| Author | SHA1 | Date | |
|---|---|---|---|
| f112bab021 | |||
| 8b39eed7bb | |||
| 07851ff7c8 |
@@ -77,4 +77,5 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected);
|
||||
Task<List<InstitutionContractPrintViewModel>> PrintAllAsync(List<long> ids);
|
||||
Task<GetInstitutionContractWorkshopsDetails> GetContractWorkshopsDetails(long id);
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Server.HttpSys;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
@@ -97,6 +100,7 @@ public class InstitutionContractListWorkshop
|
||||
{
|
||||
public string WorkshopName { get; set; }
|
||||
public int EmployeeCount { get; set; }
|
||||
public string Price { get; set; }
|
||||
public WorkshopServicesViewModel WorkshopServices { get; set; }
|
||||
}
|
||||
|
||||
@@ -104,22 +108,31 @@ public class WorkshopServicesViewModel
|
||||
{
|
||||
public bool Insurance { get; set; }
|
||||
public string InsuranceLabel => "ارسال لیست بیمه";
|
||||
public string InsurancePrice { get; set; }
|
||||
|
||||
public bool InsuranceInPerson { get; set; }
|
||||
public string InsuranceInPersonLabel => "خدمات مستقیم";
|
||||
|
||||
public string InsuranceInPersonPrice { get; set; }
|
||||
|
||||
|
||||
public bool Contract { get; set; }
|
||||
public string ContractLabel => "قرارداد و تصفیه حساب";
|
||||
|
||||
public string ContractPrice { get; set; }
|
||||
|
||||
|
||||
public bool ContractInPerson { get; set; }
|
||||
public string ContractInPersonLabel => "خدمات مستقیم";
|
||||
|
||||
public string ContractInPersonPrice { get; set; }
|
||||
|
||||
public bool RollCall { get; set; }
|
||||
public string RollCallLabel => "ساعت حضور و غیاب";
|
||||
|
||||
public string RollCallPrice { get; set; }
|
||||
|
||||
public bool RollCallInPerson { get; set; }
|
||||
public string RollCallInPersonLabel => "خدمات مستقیم";
|
||||
|
||||
public string RollCallInPersonPrice { get; set; }
|
||||
|
||||
public bool CustomizeCheckout { get; set; }
|
||||
public string CustomizeCheckoutLabel => "فیش غیر رسمی";
|
||||
public string CustomizeCheckoutPrice { get; set; }
|
||||
}
|
||||
@@ -251,8 +251,17 @@ public interface IInstitutionContractApplication
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<InstitutionContractPrintViewModel> PrintOneAsync(long id);
|
||||
|
||||
Task<GetInstitutionContractWorkshopsDetails> GetContractWorkshopsDetails(long id);
|
||||
}
|
||||
|
||||
public class GetInstitutionContractWorkshopsDetails
|
||||
{
|
||||
public List<InstitutionContractListWorkshop> Workshops { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class InstitutionContractPrintViewModel
|
||||
{
|
||||
public InstitutionContratVerificationParty FirstParty { get; set; }
|
||||
|
||||
@@ -1387,6 +1387,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return (await _institutionContractRepository.PrintAllAsync([id])).FirstOrDefault();
|
||||
}
|
||||
|
||||
public Task<GetInstitutionContractWorkshopsDetails> GetContractWorkshopsDetails(long id)
|
||||
{
|
||||
return _institutionContractRepository.GetContractWorkshopsDetails(id);
|
||||
}
|
||||
|
||||
|
||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
||||
|
||||
@@ -1291,7 +1291,9 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return new InstitutionContractListWorkshop()
|
||||
{
|
||||
EmployeeCount = w.PersonnelCount,
|
||||
Price = w.Price.ToMoney(),
|
||||
WorkshopName = workshopSelected?.WorkshopName ?? w.WorkshopName,
|
||||
|
||||
WorkshopServices = new WorkshopServicesViewModel()
|
||||
{
|
||||
Contract = w.Services.Contract,
|
||||
@@ -1300,7 +1302,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
Insurance = w.Services.Insurance,
|
||||
InsuranceInPerson = w.Services.InsuranceInPerson,
|
||||
RollCall = w.Services.RollCall,
|
||||
RollCallInPerson = w.Services.RollCallInPerson
|
||||
RollCallInPerson = w.Services.RollCallInPerson,
|
||||
|
||||
}
|
||||
};
|
||||
}).ToList() ?? [];
|
||||
@@ -2768,6 +2771,61 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<GetInstitutionContractWorkshopsDetails> GetContractWorkshopsDetails(long id)
|
||||
{
|
||||
var institutionContract = await _context.InstitutionContractSet
|
||||
.Include(x => x.WorkshopGroup)
|
||||
.ThenInclude(x => x.InitialWorkshops)
|
||||
.FirstOrDefaultAsync(x => x.id == id);
|
||||
if (institutionContract == null)
|
||||
throw new NotFoundException("قرارداد مؤسسه یافت نشد");
|
||||
|
||||
var workshops = institutionContract.WorkshopGroup.InitialWorkshops
|
||||
.Select(x =>
|
||||
{
|
||||
var plan = _planPercentageRepository.GetInstitutionPlanForWorkshop(new WorkshopTempViewModel()
|
||||
{
|
||||
CountPerson = x.PersonnelCount,
|
||||
ContractAndCheckout = x.Services.Contract,
|
||||
ContractAndCheckoutInPerson = x.Services.ContractInPerson,
|
||||
Insurance = x.Services.Insurance,
|
||||
InsuranceInPerson = x.Services.InsuranceInPerson,
|
||||
RollCall = x.Services.RollCall,
|
||||
RollCallInPerson = x.Services.RollCallInPerson,
|
||||
CustomizeCheckout = x.Services.CustomizeCheckout,
|
||||
});
|
||||
|
||||
return new InstitutionContractListWorkshop()
|
||||
{
|
||||
EmployeeCount = x.PersonnelCount,
|
||||
Price = x.Price.ToMoney(),
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopServices = new WorkshopServicesViewModel()
|
||||
{
|
||||
Contract = x.Services.Contract,
|
||||
ContractPrice =plan.ContractAndCheckout ,
|
||||
ContractInPerson = x.Services.ContractInPerson,
|
||||
ContractInPersonPrice = plan.ContractAndCheckoutInPerson,
|
||||
CustomizeCheckout = x.Services.CustomizeCheckout,
|
||||
CustomizeCheckoutPrice = plan.CustomizeCheckout,
|
||||
Insurance = x.Services.Insurance,
|
||||
InsurancePrice =plan.Insurance ,
|
||||
InsuranceInPerson = x.Services.InsuranceInPerson,
|
||||
InsuranceInPersonPrice = plan.InsuranceInPerson,
|
||||
RollCall = x.Services.RollCall,
|
||||
RollCallPrice =plan.RollCall ,
|
||||
RollCallInPerson = x.Services.RollCallInPerson,
|
||||
RollCallInPersonPrice = "0",
|
||||
}
|
||||
};
|
||||
}).ToList();
|
||||
return new GetInstitutionContractWorkshopsDetails()
|
||||
{
|
||||
Workshops = workshops
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
private InstitutionContractExtensionPaymentResponse CalculateInPersonPayment(
|
||||
InstitutionContractExtensionPlanDetail selectedPlan, double baseAmount, double tenPercent,
|
||||
|
||||
@@ -88,6 +88,12 @@ public class institutionContractController : AdminBaseController
|
||||
return await _institutionContractApplication.GetListStats(searchModel);
|
||||
}
|
||||
|
||||
[HttpGet("workshops-details/{id}")]
|
||||
public async Task<ActionResult<GetInstitutionContractWorkshopsDetails>> GetWorkshopsDetials(long id)
|
||||
{
|
||||
var result = await _institutionContractApplication.GetContractWorkshopsDetails(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش
|
||||
@@ -218,6 +224,7 @@ public class institutionContractController : AdminBaseController
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<ActionResult<OperationResult>> Remove(long id)
|
||||
{
|
||||
return BadRequest("امکان حذف قرارداد وجود ندارد");
|
||||
_institutionContractApplication.RemoveContract(id);
|
||||
return new OperationResult().Succcedded();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user