diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs
index baa34b64f..bb8be2517 100644
--- a/IRaCIS.Core.API/Controllers/ExtraController.cs
+++ b/IRaCIS.Core.API/Controllers/ExtraController.cs
@@ -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,
diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs
index 061150189..7a472d690 100644
--- a/IRaCIS.Core.Application/Helper/OSSService.cs
+++ b/IRaCIS.Core.Application/Helper/OSSService.cs
@@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application.Helper
public string SecurityToken { get; set; }
- public string Expiration { get; set; }
+ public DateTime Expiration { get; set; }
}
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj
index c1eb5c0a7..d4e5708b8 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj
@@ -71,8 +71,8 @@
-
-
+
+
diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs
index b23a1c3eb..8c2b58a6e 100644
--- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs
+++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs
@@ -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 _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 _enrollRepository,
[FromServices] IRepository _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>> 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 _enrollRepository,
[FromServices] IRepository _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 _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 _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 _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 _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 _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 _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 _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 _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 _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 _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)
diff --git a/IRaCIS.Core.Domain/Allocation/VisitTaskReReading.cs b/IRaCIS.Core.Domain/Allocation/VisitTaskReReading.cs
index 5998b6817..0adc8f6e1 100644
--- a/IRaCIS.Core.Domain/Allocation/VisitTaskReReading.cs
+++ b/IRaCIS.Core.Domain/Allocation/VisitTaskReReading.cs
@@ -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; }
diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude
index d33e52c37..cc5fddb73 100644
--- a/IRaCIS.Core.Test/DbHelper.ttinclude
+++ b/IRaCIS.Core.Test/DbHelper.ttinclude
@@ -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().Select(row =>row.Field("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().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().Select(row => new DbColumn()
{
diff --git a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
index 0be844e14..a43f6707d 100644
--- a/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
+++ b/IRaCIS.Core.Test/IRaCIS.Core.Test.csproj
@@ -12,6 +12,8 @@
..\bin
+
+
IRaCIS .Core.ServiceAsync.cs
@@ -25,22 +27,6 @@
TextTemplatingFileGenerator
IRaCIS.Core.Dto.cs
-
- TextTemplatingFileGenerator
- IRaCIS.Core.Services.cs
-
-
- TextTemplatingFileGenerator
- IRaCIS.Core.IServices.cs
-
-
- TextTemplatingFileGenerator
- IRaCIS.Core.Repository.cs
-
-
- TextTemplatingFileGenerator
- IRaCIS.Core.IRepository.cs
-
TextTemplatingFileGenerator
IRaCIS.Core.Entity.cs
@@ -67,26 +53,6 @@
True
IRaCIS.Core.Dto.tt
-
- True
- True
- IRaCIS.Core.IRepository.tt
-
-
- True
- True
- IRaCIS.Core.IServices.tt
-
-
- True
- True
- IRaCIS.Core.Repository.tt
-
-
- True
- True
- IRaCIS.Core.Services.tt
-
True
True
@@ -95,11 +61,9 @@
-
-
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt
index cdca2030c..99090292f 100644
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt
+++ b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Entity.tt
@@ -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
{
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IRepository.cs b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IRepository.cs
deleted file mode 100644
index aaed97b3f..000000000
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IRepository.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IRepository.tt b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IRepository.tt
deleted file mode 100644
index f3285219b..000000000
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IRepository.tt
+++ /dev/null
@@ -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
-{
- ///
- /// I<#=tableName#>Repository
- ///
- public interface I<#=tableName#>Repository : IRepository<<#=tableName#>>
- {
-
-
- }
-}
-<#
- manager.EndBlock();
- }
- manager.Process(true);
- #>
-
-
-
-
-
-
-
-
-
-
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IServices.cs b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IServices.cs
deleted file mode 100644
index fe5554c90..000000000
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IServices.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-//在这里设置 isPage 是否生成分页的还是不分页
-
-
-
-
-
-
-
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IServices.tt b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IServices.tt
deleted file mode 100644
index 4c91654a8..000000000
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.IServices.tt
+++ /dev/null
@@ -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
-{
- ///
- /// I<#=tableName#>Service
- ///
- 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);
- #>
-
-
-
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Repository.cs b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Repository.cs
deleted file mode 100644
index b26f15449..000000000
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Repository.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Repository.tt b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Repository.tt
deleted file mode 100644
index 0ba20925a..000000000
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Repository.tt
+++ /dev/null
@@ -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;
-{
- ///
- /// <#=tableName#>Repository
- ///
- public class <#=tableName#>Repository : Repository<<#=tableName#>>, IRepository<<#=tableName#>>
- {
- public <#=tableName#>Repository( IRaCISDBContext db) : base( db)
- {
-
- }
-
- }
-}
-<#
- manager.EndBlock();
- }
- manager.Process(true);
- #>
-
-
-
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Services.cs b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Services.cs
deleted file mode 100644
index 2faa758b0..000000000
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Services.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-//在这里设置 isPage 是否生成分页的还是不分页
-
-
-
-
diff --git a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Services.tt b/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Services.tt
deleted file mode 100644
index 7b76254a2..000000000
--- a/IRaCIS.Core.Test/TT_Template/IRaCIS.Core.Services.tt
+++ /dev/null
@@ -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
-{
- ///
- /// <#=tableName#>Service
- ///
- [ 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);
- #>
diff --git a/IRaCIS.Core.Test/UnitTest1.cs b/IRaCIS.Core.Test/UnitTest1.cs
deleted file mode 100644
index 1084bdf89..000000000
--- a/IRaCIS.Core.Test/UnitTest1.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//using NUnit.Framework;
-
-//namespace IRaCIS.Core.Test
-//{
-// public class Tests
-// {
-// [SetUp]
-// public void Setup()
-// {
-// }
-
-// [Test]
-// public void Test1()
-// {
-// Assert.Pass();
-// }
-// }
-//}
\ No newline at end of file