From 9e85ae88fa693b55d2882ec3e5278eec63e80cbc Mon Sep 17 00:00:00 2001
From: dyy <807692433@qq.com>
Date: Wed, 17 Apr 2024 17:33:38 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=9B=BA?=
=?UTF-8?q?=E5=AE=9A=E8=B5=84=E4=BA=A7=EF=BC=9A=E5=88=A0=E9=99=A4=E6=94=B9?=
=?UTF-8?q?=E4=B8=BA=E9=80=BB=E8=BE=91=E5=88=A0=E9=99=A4=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Ass_FixAssets/Ass_FixAssetsEntity.cs | 6 ++++++
.../Ass_FixAssets/Ass_FixAssetsService.cs | 8 ++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsEntity.cs
index 5aca0cd43..adac8c3b4 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsEntity.cs
@@ -234,6 +234,11 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
///
[Column("AUTOUPDATETIME")]
public DateTime? AutoUpdateTime { get; set; }
+ ///
+ /// 删除标识
+ ///
+ [Column("F_DELETEMARK")]
+ public int? F_DeleteMark { get; set; }
#endregion
#region 扩展操作
@@ -246,6 +251,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
this.CreateTime = DateTime.Now;
this.CreateUserId = LoginUserInfo.Get().userId;
this.Status = 0;
+ this.F_DeleteMark = 0;
}
///
/// 编辑调用
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsService.cs
index 6408badce..4062b9d80 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_FixAssets/Ass_FixAssetsService.cs
@@ -40,7 +40,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
var strSql = new StringBuilder();
strSql.Append("SELECT t.* ");
strSql.Append(" FROM Ass_FixAssets t ");
- strSql.Append(" WHERE 1=1 ");
+ strSql.Append(" WHERE 1=1 and (t.F_DeleteMark is null or t.F_DeleteMark != 1) ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
@@ -230,7 +230,11 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
{
try
{
- this.BaseRepository().Delete(t => keyValue.Contains(t.FAId));
+ //this.BaseRepository().Delete(t => keyValue.Contains(t.FAId));
+
+ //改为逻辑删除
+ var kv = string.Join("','", keyValue.Split(','));
+ this.BaseRepository().ExecuteBySql($"update Ass_FixAssets set FACode=('delete_'+FACode),F_DeleteMark=1,ModifyTime='{DateTime.Now}',ModifyUserId='{LoginUserInfo.Get().userId}' where FAId in ('{kv}')", null);
}
catch (Exception ex)
{