修复清理vengine

This commit is contained in:
2023-09-19 10:55:14 +08:00
parent b9e9636d72
commit 0bf34fa215
31 changed files with 289 additions and 252 deletions

View File

@@ -3,15 +3,15 @@
// https://git.tuotong-tech.com/tnb/tnb.server //
/////////////////////////////////////////////////////////////////////////////////
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Reflection;
using JNPF.Common.Core.Manager;
using JNPF.Common.Extension;
using Mapster;
using Newtonsoft.Json.Linq;
using SqlSugar;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Reflection;
using Tnb.Core;
using Yitter.IdGenerator;
@@ -24,6 +24,7 @@ namespace Tnb.Vengine.Domain;
public partial class Vmodel : Entity
{
#region Properties
/// <summary>
/// 主键标识
/// </summary>
@@ -133,7 +134,8 @@ public partial class Vmodel : Entity
public string? modifyId { get; set; }
[SugarColumn(IsIgnore = true)]
public string fullCode { get { return areaCode + "/" + vmCode; } }
public string fullCode
{ get { return areaCode + "/" + vmCode; } }
/// <summary>
/// 主键
@@ -142,7 +144,8 @@ public partial class Vmodel : Entity
{
return new object[] { id };
}
#endregion
#endregion Properties
/// <summary>
/// 通过实体创建模型
@@ -351,7 +354,6 @@ public partial class Vmodel : Entity
// TODO 按子表条件查询
if (item.Key.Contains("."))
{
}
var prop = dbProps.FirstOrDefault(a => a.code == item.Key);
if (prop == null) continue;
@@ -364,21 +366,26 @@ public partial class Vmodel : Entity
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val[1].ToString(), ConditionalType = ConditionalType.GreaterThan, CSharpTypeName = prop.csType });
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val[2].ToString(), ConditionalType = ConditionalType.LessThan, CSharpTypeName = prop.csType });
break;
case ">=<":
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val[1].ToString(), ConditionalType = ConditionalType.GreaterThanOrEqual, CSharpTypeName = prop.csType });
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val[2].ToString(), ConditionalType = ConditionalType.LessThan, CSharpTypeName = prop.csType });
break;
case "><=":
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val[1].ToString(), ConditionalType = ConditionalType.GreaterThan, CSharpTypeName = prop.csType });
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val[2].ToString(), ConditionalType = ConditionalType.LessThanOrEqual, CSharpTypeName = prop.csType });
break;
case ">=<=":
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val[1].ToString(), ConditionalType = ConditionalType.GreaterThanOrEqual, CSharpTypeName = prop.csType });
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val[2].ToString(), ConditionalType = ConditionalType.LessThanOrEqual, CSharpTypeName = prop.csType });
break;
case "in":
wheres.Add(new ConditionalModel { FieldName = prop.field, FieldValue = val.Skip(1).ToString(), ConditionalType = ConditionalType.In, CSharpTypeName = prop.csType });
break;
default: op = string.Empty; break;
}
}
@@ -425,7 +432,7 @@ public partial class Vmodel : Entity
{
return selProps.Where(a => a.navType != eNavigateType.OneToMany && a.navType != eNavigateType.ManyToMany).Select(a => new SelectModel
{
FiledName = (a.navCode == VmSelectProp.MAIN_ALIES ? "" : a.navCode + ".") + a.field,
FiledName = a.navCode + "." + a.field,
AsName = (a.navCode == VmSelectProp.MAIN_ALIES ? "" : a.navCode + "_") + a.code
}).ToList();
}
@@ -503,6 +510,4 @@ public partial class Vmodel : Entity
}
return obj;
}
}
}