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