修改版本
parent
14cc78cffc
commit
4fe915cfd8
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -77,8 +77,17 @@ 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 });
|
||||
await SaveSegmentationVersionAsync(new SaveSegmentationVersionAsyncInDto() { SegmentationId = addOrEditSegmentation.Id.Value, SEGUrl = addOrEditSegmentation.SEGUrl });
|
||||
}
|
||||
var entity = await _segmentationRepository.InsertOrUpdateAsync(addOrEditSegmentation, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
|
@ -98,7 +107,7 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
|||
.OrderByDescending(x => x.Version)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
var startTime = maxVersion != null ? maxVersion.CreateTime : data.UpdateTime;
|
||||
var startTime = maxVersion != null ? maxVersion.CreateTime :(data.SEGUpdateTime==null? DateTime.MinValue: data.SEGUpdateTime.Value);
|
||||
|
||||
var segmentList = await _segmentRepository
|
||||
.Where(x=>x.CreateTime<= startTime)
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
22238
IRaCIS.Core.Infra.EFCore/Migrations/20260512071158_SEGUpdateTime.Designer.cs
generated
Normal file
22238
IRaCIS.Core.Infra.EFCore/Migrations/20260512071158_SEGUpdateTime.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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)");
|
||||
|
|
|
|||
Loading…
Reference in New Issue