diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index 35ffd637d..7fe4bd220 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -563,7 +563,7 @@ namespace IRaCIS.Core.API.Controllers templateFileStream.Seek(0, SeekOrigin.Begin); - var ossRelativePath = oSSService.UploadToOSS(fileStream, "InspectionUpload/SiteSurvey", realFileName); + var ossRelativePath = oSSService.UploadToOSS(fileStream, "InspectionUpload/Check", realFileName); await _repository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId }); diff --git a/IRaCIS.Core.API/Properties/launchSettings.json b/IRaCIS.Core.API/Properties/launchSettings.json index 9016eb3ac..c4b3f9f6a 100644 --- a/IRaCIS.Core.API/Properties/launchSettings.json +++ b/IRaCIS.Core.API/Properties/launchSettings.json @@ -30,11 +30,11 @@ "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", "publishAllPorts": true }, - "IRaCIS.Staging": { + "IRaCIS.Uat_IRC": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Staging" + "ASPNETCORE_ENVIRONMENT": "Uat_IRC" }, "applicationUrl": "http://localhost:6100" }, @@ -46,6 +46,6 @@ }, "applicationUrl": "http://localhost:6300" } - + } } \ No newline at end of file diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 3e071a8bc..56c190f39 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -71,6 +71,8 @@ namespace IRaCIS.Core.API // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + //健康检查 + services.AddHealthChecks(); //本地化 services.AddJsonLocalization(options => options.ResourcesPath = "Resources"); @@ -167,6 +169,8 @@ namespace IRaCIS.Core.API // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public async void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + + //本地化 app.UseLocalization(); @@ -234,6 +238,8 @@ namespace IRaCIS.Core.API endpoints.MapControllers(); endpoints.MapHub("/UploadHub"); + + endpoints.MapHealthChecks("/health"); }); var hangfireJobService = app.ApplicationServices.GetRequiredService(); diff --git a/IRaCIS.Core.API/appsettings.Staging.json b/IRaCIS.Core.API/appsettings.Uat_IRC.json similarity index 78% rename from IRaCIS.Core.API/appsettings.Staging.json rename to IRaCIS.Core.API/appsettings.Uat_IRC.json index 0564ea927..570b586c7 100644 --- a/IRaCIS.Core.API/appsettings.Staging.json +++ b/IRaCIS.Core.API/appsettings.Uat_IRC.json @@ -7,8 +7,8 @@ } }, "ConnectionStrings": { - "RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Uat_IRC;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true", - "Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Uat.Study.Hangfire;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true" + "RemoteNew": "Server=47.117.164.182,1434;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true", + "Hangfire": "Server=47.117.164.182,1434;Database=Uat_IRC.Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true" }, "AliyunOSS": { diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index dab2bb588..c83ec5fc4 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -113,6 +113,14 @@ namespace IRaCIS.Core.Application.Helper } + /// + /// oosFolderPath 涓嶈 "/ "寮澶 搴旇锛 TempFolder/ChildFolder + /// + /// + /// + /// + /// + /// public string UploadToOSS(Stream fileStream, string oosFolderPath,string fileRealName) { @@ -133,7 +141,7 @@ namespace IRaCIS.Core.Application.Helper } - return ossRelativePath; + return "/" + ossRelativePath; } catch (Exception ex) { @@ -142,6 +150,13 @@ namespace IRaCIS.Core.Application.Helper } } + /// + /// oosFolderPath 涓嶈 "/ "寮澶 搴旇锛 TempFolder/ChildFolder + /// + /// + /// + /// + /// public string UploadToOSS(string localFilePath, string oosFolderPath) { var localFileName = Path.GetFileName(localFilePath); diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index debdb971a..bbd822fed 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -85,6 +85,25 @@ + + + oosFolderPath 涓嶈 "/ "寮澶 搴旇锛 TempFolder/ChildFolder + + + + + + + + + + oosFolderPath 涓嶈 "/ "寮澶 搴旇锛 TempFolder/ChildFolder + + + + + + 鍒嗛厤瑙勫垯 diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 6aa7b4ee9..fcdfa5c1f 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -165,7 +165,7 @@ namespace IRaCIS.Core.Application.Services var trialId = querySystemDocument.TrialId; - var trialInfo = await (_repository.Where(t => t.Id == querySystemDocument.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstOrDefaultAsync()); + var trialInfo = await (_repository.Where(t => t.Id == querySystemDocument.TrialId,ignoreQueryFilters:true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstOrDefaultAsync()); //绯荤粺鏂囨。鏌ヨ var systemDocumentQueryable = from needConfirmedUserType in _repository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs index 1f10264d6..51073a746 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs @@ -323,7 +323,7 @@ namespace IRaCIS.Core.Application.Services { //CRC鍙湅鍒颁粬璐熻矗鐨 - var list = await _trialSiteRepository.Where(t => t.TrialId == trialId) + var list = await _trialSiteRepository.Where(t => t.TrialId == trialId).IgnoreQueryFilters() .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.CRCUserList.Any(t => t.UserId == _userInfo.Id)) .ProjectTo(_mapper.ConfigurationProvider).OrderBy(t => t.TrialSiteCode).ToListAsync(); diff --git a/IRaCIS.Core.Domain/SQLFile/20230613.sql b/IRaCIS.Core.Domain/SQLFile/20230613.sql index c071ae52a..a5c0d9fd6 100644 --- a/IRaCIS.Core.Domain/SQLFile/20230613.sql +++ b/IRaCIS.Core.Domain/SQLFile/20230613.sql @@ -95,8 +95,6 @@ WHERE --缁存姢 鍒犻櫎涓村簥鏁版嵁閰嶇疆锛屽鑷村垹闄ら槄鐗囨湡闂 delete ReadingClinicalData ---88020000-3E02-0016-9DA6-08DB6705F7C1 ---select * from ReadingClinicalData INNER JOIN ReadModule on ReadingClinicalData.ReadingId = ReadModule.Id diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 167620876..ee620541b 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1668,6 +1668,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common } await InsertInspection(entity, type, x => new InspectionConvertDTO() { + IsDistinctionInterface= type == AuditOpt.Update ? true : false, TrialId = x.TrialId, ObjectRelationParentId = x.TrialId @@ -1718,6 +1719,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(item.Entity as TrialSiteUser, type, x => new InspectionConvertDTO { + IsDistinctionInterface= type == AuditOpt.Update ? true : false, TrialId = x.TrialId, ObjectRelationParentId = entity.TrialSite.Id, ObjectRelationParentId2 = x.UserId, diff --git a/irc_api.drone.yml b/irc_api.drone.yml index fd098d6f8..081e3e8d9 100644 --- a/irc_api.drone.yml +++ b/irc_api.drone.yml @@ -2,46 +2,89 @@ kind: pipeline type: docker name: irc-netcore-api -steps: - - name: docker-build - image: docker - pull: if-not-exists - volumes: - - name: dockersock - path: /var/run/docker.sock - - name: cached_nuget_packages - path: /drone/nuget_packages - commands: - - date +%H:%M:%S - - pwd - - docker build -t Test.Study . - - date +%H:%M:%S +clone: + disable: true #绂佺敤榛樿鍏嬮殕 + +steps: +- name: clone-repo + image: alpine/git + pull: if-not-exists + volumes: + - name: irc-test-work + path: /work + commands: + - if [ ! -e /work/netcore-repo/.git ]; then + git clone -b Test.IRC http://192.168.3.68:2000/XCKJ/irc-netcore-api.git /work/netcore-repo; + else + cd /work/netcore-repo; + git pull; + fi + + - | + if [ ! -e Dockerfile ]; then + echo 'FROM mcr.microsoft.com/dotnet/aspnet:6.0 + EXPOSE 80 + WORKDIR /app + COPY publish . + RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \ + echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free" >> /etc/apt/sources.list + RUN apt-get update && apt-get install -y curl + ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"]' > /work/Dockerfile + fi + +- name: restore-publish + image: mcr.microsoft.com/dotnet/sdk:6.0 + pull: if-not-exists + depends_on: + - clone-repo + volumes: + - name: nuget-packages + path: /root/.nuget/packages + - name: irc-test-work + path: /work + commands: + - cd /work/netcore-repo/IRaCIS.Core.API + - dotnet restore ./IRaCIS.Core.API.csproj + - rm -rf /work/publish + - cd /work/netcore-repo/IRaCIS.Core.API + - dotnet publish ./IRaCIS.Core.API.csproj -c Release --no-restore -o /work/publish + + +- name: docker-build + image: docker + pull: if-not-exists + depends_on: + - restore-publish + commands: + - cd /work + - docker build -t test-irc:v${DRONE_BUILD_NUMBER} . + volumes: + - name: irc-test-work + path: /work + - name: dockersock + path: /var/run/docker.sock - - name: docker-deploy - image: docker - pull: if-not-exists - depends_on: - - docker-build - volumes: - - name: dockersock - path: /var/run/docker.sock - commands: - - date +%H:%M:%S - - docker rm -f test-study-container - - docker run -itd -e TZ=Asia/Shanghai -e ASPNETCORE_ENVIRONMENT=Test_Study --restart=always --name test-study-container -p 8030:80 Test.Study - - date +%H:%M:%S volumes: - - name: cached_nuget_packages + - name: nuget-packages host: - path: /mnt/f/docker_publish/nuget_packages + path: /opt/cicd/nuget/packages + - name: irc-test-work + host: + path: /opt/cicd/irc-test - name: dockersock host: path: /var/run/docker.sock trigger: branch: - - master + - Test.IRC ---