Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is running Details

Uat_IRC_Net8
hang 2026-05-13 11:05:25 +08:00
commit 005b0b9e0d
9 changed files with 22319 additions and 11 deletions

View File

@ -18255,6 +18255,11 @@
文件大小,单位字节
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentationAddOrEdit.SEGUpdateTime">
<summary>
SEGUpdateTime 更新时间
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentationVersionView.StartTime">
<summary>
版本开始时间

View File

@ -59,6 +59,11 @@ public class SegmentationAddOrEdit
/// </summary>
public long FileSize { get; set; } = 0;
/// <summary>
/// SEGUpdateTime 更新时间
/// </summary>
public DateTime? SEGUpdateTime { get; set; }
}
public class SegmentationQuery:PageInput

View File

@ -1174,7 +1174,7 @@ namespace IRaCIS.Core.Application.Service
throw new BusinessValidationFailedException(_localizer["ReadModule_TumorExists"]);
}
if (await _visitTaskRepository.AnyAsync(x => readModuleId == x.SouceReadModuleId))
if (await _visitTaskRepository.AnyAsync(x => readModuleId == x.SouceReadModuleId && (x.TaskState==TaskState.Effect||x.ReadingTaskState==ReadingTaskState.HaveSigned)))
{
//---当前阅片已生成任务,操作失败。
throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]);

View File

@ -77,6 +77,15 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
if (addOrEditSegmentation.Id != null)
{
var data= await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == addOrEditSegmentation.Id);
if (addOrEditSegmentation.SEGUrl != data.SEGUrl)
{
addOrEditSegmentation.SEGUpdateTime = DateTime.Now;
}
else
{
addOrEditSegmentation.SEGUpdateTime = data.SEGUpdateTime;
}
await SaveSegmentationVersionAsync(new SaveSegmentationVersionAsyncInDto() { SegmentationId = addOrEditSegmentation.Id.Value, SEGUrl = addOrEditSegmentation.SEGUrl });
}
@ -89,21 +98,30 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
private async Task SaveSegmentationVersionAsync(SaveSegmentationVersionAsyncInDto inDto)
public async Task SaveSegmentationVersionAsync(SaveSegmentationVersionAsyncInDto inDto)
{
var data = await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == inDto.SegmentationId);
var segmentList = await _segmentRepository.Where(x => x.SegmentationId == inDto.SegmentationId).OrderBy(x=>x.SegmentNumber).ProjectTo<SegmentVersionData>(_mapper.ConfigurationProvider).ToListAsync();
if (data.SEGUrl != string.Empty&&(inDto.SEGUrl!=data.SEGUrl||inDto.IsRestore))
{
// 如果是新增或修改,记录一条版本信息
var maxVersion = await _segmentationVersionRepository
.Where(x => x.SegmentationId == data.Id)
.OrderByDescending(x => x.Version)
.FirstOrDefaultAsync();
var startTime = maxVersion != null ? maxVersion.CreateTime :(data.SEGUpdateTime==null? DateTime.MinValue: data.SEGUpdateTime.Value);
var segmentList = await _segmentRepository
.Where(x=>x.CreateTime<= startTime && (!x.IsDeleted||x.DeletedTime> startTime))
.Where(x => x.SegmentationId == inDto.SegmentationId).OrderBy(x=>x.SegmentNumber).IgnoreQueryFilters().ProjectTo<SegmentVersionData>(_mapper.ConfigurationProvider).ToListAsync();
if (data.SEGUrl != string.Empty&&(inDto.SEGUrl!=data.SEGUrl||inDto.IsRestore))
{
var newVersion = maxVersion == null ? 1 : maxVersion.Version + 1;
var startTime = maxVersion != null ? maxVersion.CreateTime : data.UpdateTime ;
var versionEntity = new SegmentationVersion
{
@ -251,7 +269,7 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
public async Task<IResponseOutput> DeleteSegment(Guid segmentId)
{
await DeleteBindingsAndAnswersAsync(null, segmentId);
var success = await _segmentRepository.DeleteFromQueryAsync(t => t.Id == segmentId, true);
var success = await _segmentRepository.SoftDeleteFromQueryAsync(t => t.Id == segmentId, true);
return ResponseOutput.Ok();
}

View File

@ -60,6 +60,11 @@ public class Segmentation : BaseFullDeleteAuditEntity
[MaxLength]
public string SEGUrl { get; set; } = string.Empty;
/// <summary>
/// SEGUpdateTime 更新时间
/// </summary>
public DateTime? SEGUpdateTime { get; set; }
/// <summary>
/// 文件大小,单位字节
/// </summary>

View File

@ -56,6 +56,11 @@ public class SegmentationVersion : BaseAddAuditEntity
public class SegmentVersionData: ISegment
{
/// <summary>
/// 这个时间很总要要记录
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 分割Id
/// </summary>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class SEGUpdateTime : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "SEGUpdateTime",
table: "Segmentation",
type: "datetime2",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SEGUpdateTime",
table: "Segmentation");
}
}
}

View File

@ -9505,6 +9505,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<bool>("IsSaved")
.HasColumnType("bit");
b.Property<DateTime?>("SEGUpdateTime")
.HasColumnType("datetime2");
b.Property<string>("SEGUrl")
.IsRequired()
.HasColumnType("nvarchar(max)");