From ce3bfaeb5c263e3226e217a8d57404e3c906dbe9 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 9 Aug 2023 17:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E5=BF=83=E8=B0=83?= =?UTF-8?q?=E7=A0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/appsettings.Test_Study.json | 6 +- IRaCIS.Core.API/appsettings.Uat_Study.json | 6 +- .../DTO/TrialSiteSurveyViewModel.cs | 23 ++++++ .../SiteSurvey/TrialSiteSurveyService.cs | 26 +++++-- .../SiteSurvey/TrialSiteUserSurveyService.cs | 46 +++++++----- .../Service/SiteSurvey/_MapConfig.cs | 3 +- irc_api.drone.yml | 72 +++++++++++++++++++ 7 files changed, 152 insertions(+), 30 deletions(-) create mode 100644 irc_api.drone.yml diff --git a/IRaCIS.Core.API/appsettings.Test_Study.json b/IRaCIS.Core.API/appsettings.Test_Study.json index 8b87a0e23..6022d9a33 100644 --- a/IRaCIS.Core.API/appsettings.Test_Study.json +++ b/IRaCIS.Core.API/appsettings.Test_Study.json @@ -28,9 +28,9 @@ "SystemEmailSendConfig": { "Port": 465, "Host": "smtp.qiye.aliyun.com", - "FromEmail": "test@extimaging.com", - "FromName": "Test_IRC", - "AuthorizationCode": "SHzyyl2021" + "FromEmail": "test-study@extimaging.com", + "FromName": "Test_Study", + "AuthorizationCode": "zhanying123" } } diff --git a/IRaCIS.Core.API/appsettings.Uat_Study.json b/IRaCIS.Core.API/appsettings.Uat_Study.json index 2f3ac31ff..ba0d344bc 100644 --- a/IRaCIS.Core.API/appsettings.Uat_Study.json +++ b/IRaCIS.Core.API/appsettings.Uat_Study.json @@ -28,9 +28,9 @@ "SystemEmailSendConfig": { "Port": 465, "Host": "smtp.qiye.aliyun.com", - "FromEmail": "test@extimaging.com", - "FromName": "Test_IRC", - "AuthorizationCode": "SHzyyl2021" + "FromEmail": "uat-study@extimaging.com", + "FromName": "Uat_Study", + "AuthorizationCode": "zhanying123" } } diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs index 613550431..bd658172b 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs @@ -167,6 +167,29 @@ namespace IRaCIS.Core.Application.Contracts + } + + public class TrialSiteSurveySelectView + { + public Guid Id { get; set; } + public TrialSiteSurveyEnum State { get; set; } + public DateTime CreateTime { get; set; } + public bool IsDeleted { get; set; } + + public string Phone { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + + public string UserName { get; set; } = string.Empty; + + } + + public class TrialSiteSurveySelectquery + { + public Guid TrialId { get; set; } + + public Guid SiteId { get; set; } + + public Guid TrialSiteSurveyId { get;set; } } ///TrialSiteSurveyQuery 列表查询参数模型 diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index da2aa69b1..dd8af2f8c 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -16,6 +16,7 @@ using MimeKit; using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Infrastructure.Extention; +using Microsoft.VisualBasic; namespace IRaCIS.Core.Application.Contracts { @@ -293,6 +294,8 @@ namespace IRaCIS.Core.Application.Contracts copy.State = TrialSiteSurveyEnum.ToSubmit; copy.Email = userInfo.EmailOrPhone; + copy.Id = Guid.Empty; + copy.CreateTime = DateAndTime.Now; if (userInfo.ReplaceUserEmailOrPhone != userInfo.EmailOrPhone) { @@ -301,19 +304,24 @@ namespace IRaCIS.Core.Application.Contracts } - copy.Id = Guid.Empty; - copy.TrialSiteEquipmentSurveyList.ForEach(t => t.Id = Guid.Empty); - copy.TrialSiteUserSurveyList.ForEach(t => { t.Id = Guid.Empty; t.IsGenerateSuccess = false; }); + + copy.TrialSiteEquipmentSurveyList = currentLatest.TrialSiteEquipmentSurveyList.Clone(); + copy.TrialSiteEquipmentSurveyList.ForEach(t => { t.Id = Guid.Empty;t.CreateTime = DateTime.Now; }); + + copy.TrialSiteUserSurveyList = currentLatest.TrialSiteUserSurveyList.Clone(); + copy.TrialSiteUserSurveyList.ForEach(t => { t.Id = Guid.Empty; t.IsGenerateSuccess = false; t.CreateTime = DateTime.Now; }); currentEntity = await _trialSiteSurveyRepository.AddAsync(copy); + + } //删除验证码历史记录 await _repository.BatchDeleteAsync(t => t.EmailOrPhone == userInfo.EmailOrPhone && t.Code == userInfo.verificationCode && t.CodeType == userInfo.verificationType); - await _repository.SaveChangesAsync(); + await _trialSiteSurveyRepository.SaveChangesAsync(); return ResponseOutput.Ok(new { @@ -428,6 +436,16 @@ namespace IRaCIS.Core.Application.Contracts return await trialSiteSurveyQueryable.ToPagedListAsync(surveyQueryDTO.PageIndex, surveyQueryDTO.PageSize, surveyQueryDTO.SortField, surveyQueryDTO.Asc); } + [HttpPost] + public async Task> GetTrialSiteSurveySelectList(TrialSiteSurveySelectquery inQuery) + { + var trialSiteSurveyQueryable = _trialSiteSurveyRepository + .Where(t=>t.Id!=inQuery.TrialSiteSurveyId) + .Where(t => t.TrialId == inQuery.TrialId && t.SiteId == inQuery.SiteId).IgnoreQueryFilters() + .ProjectTo(_mapper.ConfigurationProvider); + + return await trialSiteSurveyQueryable.ToListAsync(); + } /// /// 项目Site调研用户列表 所有site的调研用户 最新的调研表的记录的用户 new diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs index 5a375ecee..0a98f5078 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs @@ -46,24 +46,7 @@ namespace IRaCIS.Core.Application.Contracts //---已锁定,不允许操作 return ResponseOutput.NotOk(_localizer["TrialSiteUser_Locked"]); } - - if (addOrEditTrialSiteUserSurvey.UserTypeId != null && ( _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)) - { - var existSysUser = await _repository.Where(t => t.EMail == addOrEditTrialSiteUserSurvey.Email && t.UserTypeId == addOrEditTrialSiteUserSurvey.UserTypeId).Include(d=>d.UserTypeRole).FirstOrDefaultAsync(); - - - if (existSysUser != null) - { - if (existSysUser.LastName != addOrEditTrialSiteUserSurvey.LastName || existSysUser.FirstName != addOrEditTrialSiteUserSurvey.FirstName) - { - //$"该用户在系统中账户名为:{existSysUser.LastName + " / " + existSysUser.FirstName} ,与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存" - return ResponseOutput.NotOk(_localizer["TrialSiteUser_InconsistentInfo", existSysUser.UserTypeRole.UserTypeShortName, existSysUser.EMail, existSysUser.LastName + " / " + existSysUser.FirstName,existSysUser.Phone], - new { existSysUser.LastName, existSysUser.FirstName, existSysUser.Phone,existSysUser.IsTestUser,existSysUser.IsZhiZhun }, ApiResponseCodeEnum.NeedTips); - } - - } - } - + if (addOrEditTrialSiteUserSurvey.IsGenerateAccount ) { @@ -107,14 +90,39 @@ namespace IRaCIS.Core.Application.Contracts var verifyExp1 = new EntityVerifyExp() { - VerifyExp = u => u.UserTypeId == addOrEditTrialSiteUserSurvey.UserTypeId && u.Email == addOrEditTrialSiteUserSurvey.Email, + VerifyExp = u => u.UserTypeId == addOrEditTrialSiteUserSurvey.UserTypeId && u.Email == addOrEditTrialSiteUserSurvey.Email && u.TrialSiteSurveyId==addOrEditTrialSiteUserSurvey.TrialSiteSurveyId, VerifyMsg = "同一邮箱同一用户类型,生成账号的数据只允许存在一条!", IsVerify=addOrEditTrialSiteUserSurvey.IsGenerateAccount }; + if (addOrEditTrialSiteUserSurvey.UserTypeId != null) + { + var existSysUser = await _repository.Where(t => t.EMail == addOrEditTrialSiteUserSurvey.Email && t.UserTypeId == addOrEditTrialSiteUserSurvey.UserTypeId).Include(d => d.UserTypeRole).FirstOrDefaultAsync(); + + + if (existSysUser != null) + { + if (existSysUser.LastName != addOrEditTrialSiteUserSurvey.LastName || existSysUser.FirstName != addOrEditTrialSiteUserSurvey.FirstName) + { + + + var optEntity = await _trialSiteUserSurveyRepository.InsertOrUpdateAsync(addOrEditTrialSiteUserSurvey, true, verifyExp1); + + //$"该用户在系统中账户名为:{existSysUser.LastName + " / " + existSysUser.FirstName} ,与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存" + return ResponseOutput.NotOk(_localizer["TrialSiteUser_InconsistentInfo", existSysUser.UserTypeRole.UserTypeShortName, existSysUser.EMail, existSysUser.LastName + " / " + existSysUser.FirstName, existSysUser.Phone], + new { Id= optEntity.Id, existSysUser.LastName, existSysUser.FirstName, existSysUser.Phone, existSysUser.IsTestUser, existSysUser.IsZhiZhun }, ApiResponseCodeEnum.NeedTips); + } + + } + } + + var entity = await _trialSiteUserSurveyRepository.InsertOrUpdateAsync(addOrEditTrialSiteUserSurvey, true, verifyExp1); + + + return ResponseOutput.Ok(entity.Id.ToString()); } diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs b/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs index 51c756067..974ecbfd3 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs @@ -33,7 +33,8 @@ namespace IRaCIS.Core.Application.AutoMapper .ForMember(d => d.SiteName, u => u.MapFrom(s => s.Site.SiteName)) .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode)); - + CreateMap(); + var isEn_Us = false; CreateMap() .ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName)) diff --git a/irc_api.drone.yml b/irc_api.drone.yml new file mode 100644 index 000000000..f90c72887 --- /dev/null +++ b/irc_api.drone.yml @@ -0,0 +1,72 @@ +kind: pipeline +type: docker +name: dotnet-core-app-test-study + +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 + + - 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 + host: + path: /mnt/f/docker_publish/nuget_packages + - name: dockersock + host: + path: /var/run/docker.sock + +trigger: + branch: + - Test.Study + +--- + + +kind: pipeline +type: ssh +name: default + +platform: + os: windows + arch: amd64 + +clone: + disable: true #禁用默认克隆 + +server: + host: 123.56.94.154 + user: Administrator + password: WHxckj2019 + +steps: +- name: test + commands: + - Start-Process -FilePath "C:\Users\Administrator\Desktop\win.bat" + +trigger: + branch: + - master \ No newline at end of file