修改配置文件和提示
parent
af586f302c
commit
abd3f2dc7a
|
@ -38,25 +38,10 @@ namespace IRaCIS.Core.API
|
|||
})
|
||||
.Build();
|
||||
|
||||
#region Id Generate long类型
|
||||
|
||||
|
||||
//// 创建 IdGeneratorOptions 对象,请在构造函数中输入 WorkerId:
|
||||
//var options = new IdGeneratorOptions(1);
|
||||
////options.WorkerIdBitLength = 10;
|
||||
|
||||
//YitIdHelper.SetIdGenerator(options);
|
||||
|
||||
//var newId = YitIdHelper.NextId();
|
||||
|
||||
#endregion
|
||||
|
||||
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
|
||||
|
||||
for (int i= 0; i < 10;i++ )
|
||||
{
|
||||
Console.WriteLine(NewId.NextGuid());
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// Serilog
|
||||
|
|
|
@ -11,20 +11,12 @@
|
|||
//,"hang": "Server=ZHOU;Database=IRaCIS;User ID=sa;Password=sa123456;",
|
||||
|
||||
},
|
||||
"HttpReports": {
|
||||
"Transport": {
|
||||
"CollectorAddress": "http://123.56.181.144:6099/",
|
||||
"DeferSecond": 10,
|
||||
"DeferThreshold": 100
|
||||
},
|
||||
"Server": "http://localhost:6100/",
|
||||
"Service": "IRaCIS",
|
||||
"Switch": true,
|
||||
//"RequestFilter": [ "/api/health/*", "/HttpReports*" ],
|
||||
"WithRequest": true,
|
||||
"WithResponse": true,
|
||||
"WithCookie": false,
|
||||
"WithHeader": true
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": false,
|
||||
|
||||
"OpenSignDocumentBeforeWork": false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -11,20 +11,12 @@
|
|||
"RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true",
|
||||
"Remote8099": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_Test;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"
|
||||
},
|
||||
"HttpReports": {
|
||||
"Transport": {
|
||||
"CollectorAddress": "http://123.56.181.144:6099/",
|
||||
"DeferSecond": 10,
|
||||
"DeferThreshold": 100
|
||||
},
|
||||
"Server": "http://123.56.181.144:8060/",
|
||||
"Service": "IRaCIS_8060",
|
||||
"Switch": true,
|
||||
//"RequestFilter": [ "/api/health/*", "/HttpReports*" ],
|
||||
"WithRequest": true,
|
||||
"WithResponse": true,
|
||||
"WithCookie": false,
|
||||
"WithHeader": true
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": true,
|
||||
|
||||
"OpenSignDocumentBeforeWork": true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,19 +9,10 @@
|
|||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"
|
||||
},
|
||||
"HttpReports": {
|
||||
"Transport": {
|
||||
"CollectorAddress": "http://123.56.181.144:6099/",
|
||||
"DeferSecond": 10,
|
||||
"DeferThreshold": 100
|
||||
},
|
||||
"Server": "http://192.168.1.2:8000/",
|
||||
"Service": "IRaCIS_1.2_8000",
|
||||
"Switch": true,
|
||||
//"RequestFilter": [ "/api/health/*", "/HttpReports*" ],
|
||||
"WithRequest": true,
|
||||
"WithResponse": true,
|
||||
"WithCookie": false,
|
||||
"WithHeader": true
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": false,
|
||||
|
||||
"OpenSignDocumentBeforeWork": false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ public static class ExcelExportHelper
|
|||
|
||||
if (doc == null)
|
||||
{
|
||||
throw new Exception("当前code 没找到对应的导出模板文件");
|
||||
throw new Exception("当前code 没找到对应的导出模板文件,请核对是否修改了配置数据");
|
||||
}
|
||||
|
||||
var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))?.FullName;
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace IRaCIS.Core.Application.Helper;
|
|||
public static class ImageResizeHelper
|
||||
{
|
||||
|
||||
|
||||
// 采用ImageSharp组件 跨平台,不依赖windows 平台图像处理组件,这里大坑(net 6 下,之前由于Dicom处理最新组件 依赖了这个库的一个旧版本,导致缩略图bug,单独升级依赖组件才解决)
|
||||
public static void ResizeSave(string filePath, string? fileStorePath)
|
||||
{
|
||||
|
||||
|
@ -16,7 +16,6 @@ public static class ImageResizeHelper
|
|||
using (var image = SixLabors.ImageSharp.Image.Load(filePath))
|
||||
{
|
||||
|
||||
|
||||
image.Mutate(x => x.Resize(500, 500));
|
||||
|
||||
image.Save(fileStorePath);
|
||||
|
|
|
@ -142,6 +142,12 @@ namespace IRaCIS.Application.Services
|
|||
[HttpGet]
|
||||
public async Task<IResponseOutput> InitSetUserNameAndPwd (Guid userId, string newUserName,string newPWd)
|
||||
{
|
||||
|
||||
//正则 至少8个字符,至少1个大写字母,1个小写字母,1个数字和1个特殊字符:
|
||||
//^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}
|
||||
|
||||
|
||||
|
||||
await _userRepository.UpdatePartialFromQueryAsync(userId, u => new User()
|
||||
{
|
||||
UserName = newUserName,
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
Task<IResponseOutput> AddOrUpdateTrialQCQuestionConfigure(TrialQCQuestionAddOrEdit addOrEditTrialQCQuestionConfigure);
|
||||
Task<IResponseOutput> BatchAddTrialQCQuestionConfigure(List<TrialQCQuestionConfigureBatchAdd> batchList, Guid trialId);
|
||||
Task<IResponseOutput> DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId);
|
||||
Task<IResponseOutput> DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId, Guid trialId);
|
||||
//Task<List<TrialQCQuestionConfigureView>> GetTrialQCQuestionConfigureList(TrialQCQuestionQuery queryTrialQCQuestionConfigure);
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
|
@ -39,9 +40,14 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
|
||||
var signInfo = await _repository.Where<Trial>(t => t.Id == queryTrialQCQuestionConfigure.TrialId)
|
||||
.Select(trial => new {trial.QCProcessEnum, trial.QCQuestionConfirmedTime, trial.QCQuestionConfirmedUserId,
|
||||
RealName = trial.QCQuestionConfirmedUser.FullName, trial.QCQuestionConfirmedUser.UserName,
|
||||
IsHaveQCQuestion= isHaveQCQuestion
|
||||
.Select(trial => new
|
||||
{
|
||||
trial.QCProcessEnum,
|
||||
trial.QCQuestionConfirmedTime,
|
||||
trial.QCQuestionConfirmedUserId,
|
||||
RealName = trial.QCQuestionConfirmedUser.FullName,
|
||||
trial.QCQuestionConfirmedUser.UserName,
|
||||
IsHaveQCQuestion = isHaveQCQuestion
|
||||
}).FirstOrDefaultAsync();
|
||||
|
||||
return (list, signInfo!);
|
||||
|
@ -100,6 +106,15 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
return ids;
|
||||
}
|
||||
|
||||
|
||||
public async Task VerifyIsQCConfirmedAsync(Guid trialId)
|
||||
{
|
||||
if (!await _repository.AnyAsync<Trial>(t => t.Id == trialId && t.QCQuestionConfirmedUserId == null))
|
||||
{
|
||||
throw new BusinessValidationFailedException("QC已确认,不允许操作");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加 QC 问题
|
||||
/// </summary>
|
||||
|
@ -109,10 +124,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
[HttpPost("{trialId:guid}")]
|
||||
public async Task<IResponseOutput> BatchAddTrialQCQuestionConfigure(List<TrialQCQuestionConfigureBatchAdd> batchList, Guid trialId)
|
||||
{
|
||||
if (!await _repository.AnyAsync<Trial>(t => t.Id == trialId && t.QCQuestionConfirmedUserId == null))
|
||||
{
|
||||
return ResponseOutput.NotOk("QC已确认,不允许操作");
|
||||
}
|
||||
|
||||
await VerifyIsQCConfirmedAsync(trialId);
|
||||
|
||||
var batchConfigList = _mapper.Map<List<TrialQCQuestion>>(batchList);
|
||||
batchConfigList.ForEach(t => t.TrialId = trialId);
|
||||
|
@ -127,10 +140,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialQCQuestionConfigure(TrialQCQuestionAddOrEdit addOrEditTrialQCQuestionConfigure)
|
||||
{
|
||||
if (!await _repository.AnyAsync<Trial>(t => t.Id == addOrEditTrialQCQuestionConfigure.TrialId && t.QCQuestionConfirmedUserId == null))
|
||||
{
|
||||
return ResponseOutput.NotOk("QC已确认,不允许操作");
|
||||
}
|
||||
await VerifyIsQCConfirmedAsync(addOrEditTrialQCQuestionConfigure.TrialId);
|
||||
|
||||
var entity = await _trialQcQuestionRepository.InsertOrUpdateAsync(addOrEditTrialQCQuestionConfigure, true);
|
||||
|
||||
|
@ -138,26 +148,23 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
}
|
||||
|
||||
|
||||
[HttpDelete("{trialQCQuestionConfigureId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId)
|
||||
[HttpDelete("{trialId:guid}/{trialQCQuestionConfigureId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId, Guid trialId)
|
||||
{
|
||||
await VerifyIsQCConfirmedAsync(trialId);
|
||||
|
||||
if (await _trialQcQuestionRepository.AnyAsync(t => t.ParentId == trialQCQuestionConfigureId))
|
||||
{
|
||||
return ResponseOutput.NotOk("请先清除子问题 再删除父问题");
|
||||
}
|
||||
|
||||
if (!await _trialQcQuestionRepository.AnyAsync(t => t.Id == trialQCQuestionConfigureId && t.Trial.QCQuestionConfirmedUserId == null))
|
||||
{
|
||||
return ResponseOutput.NotOk("QC已确认,不允许操作");
|
||||
}
|
||||
|
||||
if (await _repository.AnyAsync<TrialQCQuestionAnswer>(t => t.TrialQCQuestionConfigureId == trialQCQuestionConfigureId))
|
||||
{
|
||||
return ResponseOutput.NotOk("已有QC审核记录,不允许删除该问题项");
|
||||
}
|
||||
|
||||
var success = await _trialQcQuestionRepository.DeleteFromQueryAsync(t => t.Id == trialQCQuestionConfigureId,true);
|
||||
var success = await _trialQcQuestionRepository.DeleteFromQueryAsync(t => t.Id == trialQCQuestionConfigureId, true);
|
||||
return ResponseOutput.Result(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue