Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
c03fd57c25
|
@ -331,7 +331,9 @@ namespace IRaCIS.Api.Controllers
|
|||
{
|
||||
AccessKeyId = credentials.AccessKeyId,
|
||||
AccessKeySecret = credentials.AccessKeySecret,
|
||||
Expiration = credentials.Expiration,
|
||||
|
||||
//转为服务器时区,最后统一转为客户端时区
|
||||
Expiration = TimeZoneInfo.ConvertTimeFromUtc(DateTime.Parse(credentials.Expiration), TimeZoneInfo.Local),
|
||||
SecurityToken = credentials.SecurityToken,
|
||||
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application.Helper
|
|||
|
||||
|
||||
public string SecurityToken { get; set; }
|
||||
public string Expiration { get; set; }
|
||||
public DateTime Expiration { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -71,8 +71,8 @@
|
|||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.3" />
|
||||
<PackageReference Include="fo-dicom.Codecs" Version="5.14.5" />
|
||||
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
||||
<PackageReference Include="MailKit" Version="4.2.0" />
|
||||
<PackageReference Include="MimeKit" Version="4.2.0" />
|
||||
<PackageReference Include="MailKit" Version="4.7.1.1" />
|
||||
<PackageReference Include="MimeKit" Version="4.7.1" />
|
||||
<PackageReference Include="MiniExcel" Version="1.34.1" />
|
||||
<PackageReference Include="Minio" Version="6.0.3" />
|
||||
<PackageReference Include="MiniWord" Version="0.8.0" />
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace IRaCIS.Core.Application
|
|||
_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM)
|
||||
{
|
||||
return await _trialRepository
|
||||
.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() > 0)
|
||||
|
@ -74,7 +75,7 @@ namespace IRaCIS.Core.Application
|
|||
}
|
||||
else
|
||||
{
|
||||
var trialDocStat = await _trialRepository/*.AsQueryable(true)*/.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
var trialDocStat = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(!_userInfo.IsAdmin, c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))
|
||||
.Count() > 0)
|
||||
|
@ -105,6 +106,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository
|
||||
.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new CheckToBeDoneDto()
|
||||
{
|
||||
|
@ -125,10 +127,12 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync();
|
||||
|
||||
var totalToBeRepliedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
var totalToBeRepliedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng &&
|
||||
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).CountAsync();
|
||||
|
||||
|
@ -149,7 +153,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _visitTaskReReadingRepository
|
||||
var query = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed)
|
||||
.GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId })
|
||||
|
@ -170,7 +174,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
var toBeApprovalCount = _visitTaskReReadingRepository
|
||||
var toBeApprovalCount = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed).Count();
|
||||
|
||||
|
@ -191,7 +195,7 @@ namespace IRaCIS.Core.Application
|
|||
, [FromServices] IRepository<Enroll> _enrollRepository,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new ReviewerSelectToBeDoneDto()
|
||||
{
|
||||
|
@ -209,7 +213,8 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
|
||||
|
||||
return ResponseOutput.Ok(result, new { ToBeApprovalCount = toBeApprovalCount }); ;
|
||||
|
@ -226,7 +231,7 @@ namespace IRaCIS.Core.Application
|
|||
public async Task<IResponseOutput<PageOutput<GetPMClinicalDataToBeDoneListOutDto>>> GetPMClinicalDataToBeDoneList(ReviewerSelectToBeDoneQuery inQuery)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new GetPMClinicalDataToBeDoneListOutDto()
|
||||
{
|
||||
|
@ -246,7 +251,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
|
||||
var all = await _trialRepository
|
||||
var all = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new GetPMClinicalDataToBeDoneListOutDto()
|
||||
{
|
||||
|
@ -275,7 +280,7 @@ namespace IRaCIS.Core.Application
|
|||
, [FromServices] IRepository<Enroll> _enrollRepository,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new ReviewerSelectToBeDoneDto()
|
||||
{
|
||||
|
@ -294,7 +299,8 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount }); ;
|
||||
|
@ -314,7 +320,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
|
||||
{
|
||||
var query = _visitTaskReReadingRepository
|
||||
var query = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
.GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId })
|
||||
|
@ -335,7 +341,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
var toBeApprovalCount = _visitTaskReReadingRepository
|
||||
var toBeApprovalCount = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed).Count();
|
||||
|
||||
|
@ -362,7 +368,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||
.Select(t => new ImageClinicalDataToBeDoneDto()
|
||||
|
@ -382,7 +388,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
//.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||
.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count();
|
||||
|
||||
|
@ -404,7 +410,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||
.Select(t => new ImageClinicalDataToBeDoneDto()
|
||||
|
@ -440,7 +446,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
result.CurrentPageData = result.CurrentPageData.Where(x => x.ReadModuleCount != 0).ToList();
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
//.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||
.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count();
|
||||
|
||||
|
@ -465,7 +471,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new ImageQuestionToBeDoneDto()
|
||||
{
|
||||
|
@ -490,7 +496,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.SelectMany(c => c.QCChallengeList)
|
||||
|
@ -513,7 +519,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new ImageCheckQuestionToBeDoneDto()
|
||||
{
|
||||
|
@ -536,7 +542,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count();
|
||||
|
@ -559,7 +565,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new ImageReUploadToBeDoneDto()
|
||||
{
|
||||
|
@ -582,7 +588,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count();
|
||||
|
||||
|
@ -606,7 +612,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||
.Select(t => new ImageSubmittedToBeDoneDto()
|
||||
{
|
||||
|
@ -632,7 +638,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count();
|
||||
|
@ -662,7 +668,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit)
|
||||
.Select(t => new ImageQualityToBeDoneDto()
|
||||
|
@ -692,12 +698,13 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
|
||||
var toBeClaimedCount = _subjectVisitRepository
|
||||
var toBeClaimedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed && t.AuditState != AuditStateEnum.QCFailed)
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count();
|
||||
|
||||
|
||||
var toBeReviwedCount = _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
var toBeReviwedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(u => u.CurrentActionUserId == _userInfo.Id).Count();
|
||||
|
||||
|
||||
|
@ -719,7 +726,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var query = _trialRepository
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Select(t => new ImageQuestionToBeDoneDto()
|
||||
{
|
||||
|
@ -740,7 +747,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count();
|
||||
|
@ -883,7 +890,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
var result = await newQuery.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var toBeDealedCount = _trialRepository
|
||||
var toBeDealedCount = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.SelectMany(t => t.VisitTaskList)
|
||||
.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect && t.TrialReadingCriterion.IsSigned == true && t.TrialReadingCriterion.IsConfirm == true)
|
||||
|
@ -911,7 +918,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository)
|
||||
{
|
||||
|
||||
var query = _taskMedicalReviewRepository
|
||||
var query = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.VisitTask.DoctorUserId == _userInfo.Id)
|
||||
.GroupBy(t => new
|
||||
|
@ -955,7 +962,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
|
||||
var toBeDealedCount = _taskMedicalReviewRepository
|
||||
var toBeDealedCount = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.DoctorUserId == _userInfo.Id)
|
||||
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM)
|
||||
|
@ -988,7 +995,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
#region 废弃不能对包含聚合或子查询的表达式执行聚合函数
|
||||
var query = _taskMedicalReviewRepository
|
||||
var query = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
.GroupBy(t => new
|
||||
|
@ -1026,7 +1033,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
|
||||
var toBeReplyedQuery = _taskMedicalReviewRepository
|
||||
var toBeReplyedQuery = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing);
|
||||
|
@ -1034,7 +1041,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
var toBeReplyedCount = toBeReplyedQuery.Count();
|
||||
|
||||
var tobeReviewedCount = _taskMedicalReviewRepository
|
||||
var tobeReviewedCount = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count();
|
||||
|
@ -1111,7 +1118,8 @@ namespace IRaCIS.Core.Application
|
|||
var isSPMOrCPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM;
|
||||
var isIR = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer;
|
||||
|
||||
var needSignTrialCount = await _trialRepository.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped).Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
var needSignTrialCount = await _trialRepository.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
|
||||
&& !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)).Count() > 0).CountAsync();
|
||||
|
||||
|
@ -1131,7 +1139,7 @@ namespace IRaCIS.Core.Application
|
|||
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId);
|
||||
|
||||
|
||||
var siteSurveyCount = await _trialRepository
|
||||
var siteSurveyCount = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() > 0)
|
||||
|
|
|
@ -35,6 +35,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
{
|
||||
public static readonly string ConnectionString = "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true";
|
||||
public static readonly string DbDatabase = "Test_IRC";
|
||||
//表名称用字符串,拼接
|
||||
//表名称用字符串,拼接
|
||||
public static readonly string TableName = "UserFeedBack";
|
||||
//具体文件里面 例如service 可以配置是否分页
|
||||
//具体文件里面 例如service 可以配置是否分页
|
||||
}
|
||||
#>
|
||||
<#+
|
||||
|
@ -21,12 +21,12 @@
|
|||
}
|
||||
string sql = string.Format(@"SELECT
|
||||
obj.name tablename
|
||||
from sys.objects obj
|
||||
inner join dbo.sysindexes idx on obj.object_id=idx.id and idx.indid<=1
|
||||
INNER JOIN sys.schemas schem ON obj.schema_id=schem.schema_id
|
||||
left join sys.extended_properties g ON (obj.object_id = g.major_id AND g.minor_id = 0 AND g.name= 'MS_Description')
|
||||
where type='U' {0}
|
||||
order by obj.name",tables);
|
||||
from {0}.sys.objects obj
|
||||
inner join {0}.dbo.sysindexes idx on obj.object_id=idx.id and idx.indid<=1
|
||||
INNER JOIN {0}.sys.schemas schem ON obj.schema_id=schem.schema_id
|
||||
left join {0}.sys.extended_properties g ON (obj.object_id = g.major_id AND g.minor_id = 0 AND g.name= 'MS_Description')
|
||||
where type='U' {1}
|
||||
order by obj.name", database,tables);
|
||||
DataTable dt = GetDataTable(connectionString, sql);
|
||||
return dt.Rows.Cast<DataRow>().Select(row =>row.Field<string>("tablename")).ToList();
|
||||
}
|
||||
|
@ -50,11 +50,11 @@
|
|||
ELSE 0
|
||||
END
|
||||
AS BIT) HasPrimaryKey
|
||||
from sys.objects obj
|
||||
inner join dbo.sysindexes idx on obj.object_id=idx.id and idx.indid<=1
|
||||
INNER JOIN sys.schemas schem ON obj.schema_id=schem.schema_id
|
||||
where type='U' {0}
|
||||
order by obj.name", tables);
|
||||
from {0}.sys.objects obj
|
||||
inner join {0}.dbo.sysindexes idx on obj.object_id=idx.id and idx.indid<=1
|
||||
INNER JOIN {0}.sys.schemas schem ON obj.schema_id=schem.schema_id
|
||||
where type='U' {1}
|
||||
order by obj.name", database, tables);
|
||||
#endregion
|
||||
DataTable dt = GetDataTable(connectionString, sql);
|
||||
return dt.Rows.Cast<DataRow>().Select(row => new DbTable
|
||||
|
@ -79,8 +79,8 @@
|
|||
ic.column_id,
|
||||
ic.index_column_id,
|
||||
ic.object_id
|
||||
FROM sys.indexes idx
|
||||
INNER JOIN sys.index_columns ic ON idx.index_id = ic.index_id AND idx.object_id = ic.object_id
|
||||
FROM {0}.sys.indexes idx
|
||||
INNER JOIN {0}.sys.index_columns ic ON idx.index_id = ic.index_id AND idx.object_id = ic.object_id
|
||||
WHERE idx.object_id =OBJECT_ID(@tableName) AND idx.is_primary_key=1
|
||||
)
|
||||
select
|
||||
|
@ -102,14 +102,14 @@
|
|||
cast(colm.precision as int) Precision,
|
||||
cast(colm.scale as int) Scale,
|
||||
prop.value Remark
|
||||
from sys.columns colm
|
||||
inner join sys.types systype on colm.system_type_id=systype.system_type_id and colm.user_type_id=systype.user_type_id
|
||||
left join sys.extended_properties prop on colm.object_id=prop.major_id and colm.column_id=prop.minor_id
|
||||
from {0}.sys.columns colm
|
||||
inner join {0}.sys.types systype on colm.system_type_id=systype.system_type_id and colm.user_type_id=systype.user_type_id
|
||||
left join {0}.sys.extended_properties prop on colm.object_id=prop.major_id and colm.column_id=prop.minor_id
|
||||
LEFT JOIN indexCTE ON colm.column_id=indexCTE.column_id AND colm.object_id=indexCTE.object_id
|
||||
where colm.object_id=OBJECT_ID(@tableName)
|
||||
order by colm.column_id");
|
||||
order by colm.column_id", database);
|
||||
#endregion
|
||||
SqlParameter param = new SqlParameter("@tableName", SqlDbType.NVarChar, 100) { Value = string.Format("{0}.{1}", schema, tableName) };
|
||||
SqlParameter param = new SqlParameter("@tableName", SqlDbType.NVarChar, 100) { Value = string.Format("{0}.{1}.{2}", database, schema, tableName) };
|
||||
DataTable dt = GetDataTable(connectionString, sql, param);
|
||||
return dt.Rows.Cast<DataRow>().Select(row => new DbColumn()
|
||||
{
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
<OutputPath>..\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="TT_Template\IRaCIS .Core.ServiceAsync.tt">
|
||||
<LastGenOutput>IRaCIS .Core.ServiceAsync.cs</LastGenOutput>
|
||||
|
@ -25,22 +27,6 @@
|
|||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>IRaCIS.Core.Dto.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="TT_Template\IRaCIS.Core.Services.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>IRaCIS.Core.Services.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="TT_Template\IRaCIS.Core.IServices.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>IRaCIS.Core.IServices.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="TT_Template\IRaCIS.Core.Repository.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>IRaCIS.Core.Repository.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="TT_Template\IRaCIS.Core.IRepository.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>IRaCIS.Core.IRepository.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="TT_Template\IRaCIS.Core.Entity.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>IRaCIS.Core.Entity.cs</LastGenOutput>
|
||||
|
@ -67,26 +53,6 @@
|
|||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>IRaCIS.Core.Dto.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="TT_Template\IRaCIS.Core.IRepository.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>IRaCIS.Core.IRepository.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="TT_Template\IRaCIS.Core.IServices.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>IRaCIS.Core.IServices.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="TT_Template\IRaCIS.Core.Repository.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>IRaCIS.Core.Repository.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="TT_Template\IRaCIS.Core.Services.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>IRaCIS.Core.Services.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="TT_Template\IRaCIS.Core.Entity.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
|
@ -95,11 +61,9 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Test\Audit\" />
|
||||
<Folder Include="TT_Template\Dto_New\" />
|
||||
<Folder Include="TT_Template\IServices_New\" />
|
||||
<Folder Include="TT_Template\Models_New\" />
|
||||
<Folder Include="TT_Template\Repositories_New\" />
|
||||
<Folder Include="TT_Template\Services_New\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ using System;
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel;
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
<#@ template debug="false" hostspecific="true" language="C#" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#@ assembly name="System.Core.dll" #>
|
||||
<#@ assembly name="System.Data.dll" #>
|
||||
<#@ assembly name="System.Data.DataSetExtensions.dll" #>
|
||||
<#@ assembly name="System.Xml.dll" #>
|
||||
<#@ import namespace="System" #>
|
||||
<#@ import namespace="System.Xml" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Data" #>
|
||||
<#@ import namespace="System.Data.SqlClient" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ include file="$(ProjectDir)DbHelper.ttinclude" #>
|
||||
<#@ include file="$(ProjectDir)ModelAuto.ttinclude" #>
|
||||
<# var manager = new Manager(Host, GenerationEnvironment, true); #>
|
||||
|
||||
|
||||
<#
|
||||
var OutputPath1 =Path.GetDirectoryName(Host.TemplateFile+"..");
|
||||
OutputPath1=Path.Combine(OutputPath1,"IRepositories_New");
|
||||
if (!Directory.Exists(OutputPath1))
|
||||
{
|
||||
Directory.CreateDirectory(OutputPath1);
|
||||
}
|
||||
#>
|
||||
|
||||
|
||||
<# foreach (var item in DbHelper.GetDbTablesNew(config.ConnectionString, config.DbDatabase,config.TableName))
|
||||
{
|
||||
var tableName=item.ToString();
|
||||
manager.StartBlock("I"+tableName+"Repository"+".cs",OutputPath1);//文件名
|
||||
#>
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 <#=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")#>
|
||||
// 使用泛型仓储注册,现在不需要这个文件了,作为学习例子
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Domain.IRepository;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
namespace IRaCIS.Core.Domain.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// I<#=tableName#>Repository
|
||||
/// </summary>
|
||||
public interface I<#=tableName#>Repository : IRepository<<#=tableName#>>
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
<#
|
||||
manager.EndBlock();
|
||||
}
|
||||
manager.Process(true);
|
||||
#>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
|
||||
//在这里设置 isPage 是否生成分页的还是不分页
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
<#@ template debug="false" hostspecific="true" language="C#" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#@ assembly name="System.Core.dll" #>
|
||||
<#@ assembly name="System.Data.dll" #>
|
||||
<#@ assembly name="System.Data.DataSetExtensions.dll" #>
|
||||
<#@ assembly name="System.Xml.dll" #>
|
||||
<#@ import namespace="System" #>
|
||||
<#@ import namespace="System.Xml" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Data" #>
|
||||
<#@ import namespace="System.Data.SqlClient" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ include file="$(ProjectDir)DbHelper.ttinclude" #>
|
||||
<#@ include file="$(ProjectDir)ModelAuto.ttinclude" #>
|
||||
<# var manager = new Manager(Host, GenerationEnvironment, true); #>
|
||||
|
||||
//在这里设置 isPage 是否生成分页的还是不分页
|
||||
|
||||
<#
|
||||
var isPage=false;
|
||||
#>
|
||||
|
||||
<#
|
||||
var OutputPath1 =Path.GetDirectoryName(Host.TemplateFile+"..");
|
||||
OutputPath1=Path.Combine(OutputPath1,"IServices_New");
|
||||
if (!Directory.Exists(OutputPath1))
|
||||
{
|
||||
Directory.CreateDirectory(OutputPath1);
|
||||
}
|
||||
#>
|
||||
|
||||
|
||||
<# foreach (var item in DbHelper.GetDbTablesNew(config.ConnectionString, config.DbDatabase,config.TableName))
|
||||
{
|
||||
var tableName=item.ToString();
|
||||
manager.StartBlock("I"+tableName+"Service"+".cs",OutputPath1);//文件名
|
||||
#>
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 <#=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")#>
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// I<#=tableName#>Service
|
||||
/// </summary>
|
||||
public interface I<#=tableName#>Service
|
||||
{
|
||||
|
||||
<# if(isPage){#>
|
||||
PageOutput<<#=tableName#>View> Get<#=tableName#>List(<#=tableName#>Query query<#=tableName#>);
|
||||
<# } else {#>
|
||||
|
||||
List<<#=tableName#>View> Get<#=tableName#>List(<#=tableName#>Query query<#=tableName#>);
|
||||
<# }#>
|
||||
|
||||
IResponseOutput AddOrUpdate<#=tableName#>(<#=tableName#>AddOrEdit addOrEdit<#=tableName#>);
|
||||
|
||||
IResponseOutput Delete<#=tableName#>(Guid <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Id);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
<#
|
||||
manager.EndBlock();
|
||||
}
|
||||
manager.Process(true);
|
||||
#>
|
||||
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<#@ template debug="false" hostspecific="true" language="C#" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#@ assembly name="System.Core.dll" #>
|
||||
<#@ assembly name="System.Data.dll" #>
|
||||
<#@ assembly name="System.Data.DataSetExtensions.dll" #>
|
||||
<#@ assembly name="System.Xml.dll" #>
|
||||
<#@ import namespace="System" #>
|
||||
<#@ import namespace="System.Xml" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Data" #>
|
||||
<#@ import namespace="System.Data.SqlClient" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ include file="$(ProjectDir)DbHelper.ttinclude" #>
|
||||
<#@ include file="$(ProjectDir)ModelAuto.ttinclude" #>
|
||||
<# var manager = new Manager(Host, GenerationEnvironment, true); #>
|
||||
|
||||
|
||||
|
||||
<#
|
||||
var OutputPath1 =Path.GetDirectoryName(Host.TemplateFile+"..");
|
||||
OutputPath1=Path.Combine(OutputPath1,"Repositories_New");
|
||||
if (!Directory.Exists(OutputPath1))
|
||||
{
|
||||
Directory.CreateDirectory(OutputPath1);
|
||||
}
|
||||
#>
|
||||
|
||||
|
||||
<# foreach (var item in DbHelper.GetDbTablesNew(config.ConnectionString, config.DbDatabase,config.TableName))
|
||||
{
|
||||
var tableName=item.ToString();
|
||||
manager.StartBlock(tableName+"Repository"+".cs",OutputPath1);//文件名
|
||||
#>
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 <#=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")#>
|
||||
// 使用泛型仓储注册,现在不需要这个文件了,作为学习例子
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Domain.IRepository;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
namespace IRaCIS.Core.Domain.Repository;
|
||||
{
|
||||
/// <summary>
|
||||
/// <#=tableName#>Repository
|
||||
/// </summary>
|
||||
public class <#=tableName#>Repository : Repository<<#=tableName#>>, IRepository<<#=tableName#>>
|
||||
{
|
||||
public <#=tableName#>Repository( IRaCISDBContext db) : base( db)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
<#
|
||||
manager.EndBlock();
|
||||
}
|
||||
manager.Process(true);
|
||||
#>
|
||||
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
|
||||
|
||||
|
||||
//在这里设置 isPage 是否生成分页的还是不分页
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
<#@ template debug="false" hostspecific="true" language="C#" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#@ assembly name="System.Core.dll" #>
|
||||
<#@ assembly name="System.Data.dll" #>
|
||||
<#@ assembly name="System.Data.DataSetExtensions.dll" #>
|
||||
<#@ assembly name="System.Xml.dll" #>
|
||||
<#@ import namespace="System" #>
|
||||
<#@ import namespace="System.Xml" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Data" #>
|
||||
<#@ import namespace="System.Data.SqlClient" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
|
||||
<#@ include file="$(ProjectDir)DbHelper.ttinclude" #>
|
||||
<#@ include file="$(ProjectDir)ModelAuto.ttinclude" #>
|
||||
<# var manager = new Manager(Host, GenerationEnvironment, true); #>
|
||||
|
||||
|
||||
//在这里设置 isPage 是否生成分页的还是不分页
|
||||
|
||||
<#
|
||||
var isPage=false;
|
||||
#>
|
||||
|
||||
<#
|
||||
var OutputPath1 =Path.GetDirectoryName(Host.TemplateFile+"..");
|
||||
OutputPath1=Path.Combine(OutputPath1,"Services_New");
|
||||
if (!Directory.Exists(OutputPath1))
|
||||
{
|
||||
Directory.CreateDirectory(OutputPath1);
|
||||
}
|
||||
#>
|
||||
|
||||
|
||||
<# foreach (var item in DbHelper.GetDbTablesNew(config.ConnectionString, config.DbDatabase,config.TableName))
|
||||
{
|
||||
var tableName=item.ToString();
|
||||
manager.StartBlock(tableName+"Service"+".cs",OutputPath1);//文件名
|
||||
#>
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 <#=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")#>
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// <#=tableName#>Service
|
||||
/// </summary>
|
||||
[ ApiExplorerSettings(GroupName = "Test")]
|
||||
public class <#=tableName#>Service: BaseService, I<#=tableName#>Service
|
||||
{
|
||||
|
||||
private readonly IRepository<<#=tableName#>> _<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository;
|
||||
|
||||
public <#=tableName#>Service(IRepository<<#=tableName#>> <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository)
|
||||
{
|
||||
_<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository = <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository;
|
||||
}
|
||||
|
||||
<# if(isPage){#>
|
||||
public PageOutput<<#=tableName#>View> Get<#=tableName#>List(<#=tableName#>Query query<#=tableName#>)
|
||||
{
|
||||
|
||||
var <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Queryable =
|
||||
|
||||
_<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository.AsQueryable()
|
||||
.ProjectTo<<#=tableName#>View>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList=<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Queryable.
|
||||
.ToPagedList(query<#=tableName#>.PageIndex, query<#=tableName#>.PageSize, string.IsNullOrWhiteSpace(query<#=tableName#>.SortField) ? "Id" : query<#=tableName#>.SortField,
|
||||
hospitalSearchModel.Asc);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
<# } else {#>
|
||||
|
||||
public List<<#=tableName#>View> Get<#=tableName#>List(<#=tableName#>Query query<#=tableName#>)
|
||||
{
|
||||
|
||||
|
||||
var <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Queryable = _<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository
|
||||
.Where(<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Lambda).ProjectTo<<#=tableName#>View>(_mapper.ConfigurationProvider);
|
||||
|
||||
return <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Queryable.ToList();
|
||||
}
|
||||
<# }#>
|
||||
|
||||
|
||||
public IResponseOutput AddOrUpdate<#=tableName#>(<#=tableName#>AddOrEdit addOrEdit<#=tableName#>)
|
||||
{
|
||||
// 在此处拷贝automapper 映射
|
||||
// CreateMap<<#=tableName#>AddOrEdit, <#=tableName#>>();
|
||||
// CreateMap< <#=tableName#>,<#=tableName#>AddOrEdit>();
|
||||
|
||||
var entity = _<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository.UseMapper(_mapper).InsertOrUpdate(addOrEdit<#=tableName#>, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
|
||||
[HttpDelete("{<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Id:guid}")]
|
||||
public IResponseOutput Delete<#=tableName#>(Guid <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Id)
|
||||
{
|
||||
var success = _<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository.Delete(t => t.Id == <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Id);
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
<#
|
||||
manager.EndBlock();
|
||||
}
|
||||
manager.Process(true);
|
||||
#>
|
|
@ -1,18 +0,0 @@
|
|||
//using NUnit.Framework;
|
||||
|
||||
//namespace IRaCIS.Core.Test
|
||||
//{
|
||||
// public class Tests
|
||||
// {
|
||||
// [SetUp]
|
||||
// public void Setup()
|
||||
// {
|
||||
// }
|
||||
|
||||
// [Test]
|
||||
// public void Test1()
|
||||
// {
|
||||
// Assert.Pass();
|
||||
// }
|
||||
// }
|
||||
//}
|
Loading…
Reference in New Issue