This commit is contained in:
DEVICE8\12494
2023-05-18 18:44:16 +08:00
parent 82c94d9707
commit 9d30038a7d
23 changed files with 618 additions and 166 deletions

View File

@@ -13,6 +13,7 @@ using Tnb.EquipMgr.Entities.Dto;
using Tnb.EquipMgr.Entities;
using Tnb.EquipMgr.Utils;
using Mapster;
using Tnb.Common.Extension;
namespace Tnb.EquipMgr
{
@@ -47,18 +48,8 @@ namespace Tnb.EquipMgr
var pk = id;
TDest entity = new();
entity.id = SnowflakeIdHelper.NextId();
if (!PropertySet<TDest>.ValueFactories.TryGetValue(mColumnName, out Action<object, object>? setGroupIdAction))
{
setGroupIdAction = PropertySet<TDest>.CreateSetPropertyValueAction(mColumnName);
PropertySet<TDest>.ValueFactories.Add(mColumnName, setGroupIdAction);
}
setGroupIdAction(entity, input.item_group_id);
if (!PropertySet<TDest>.ValueFactories.TryGetValue(name, out Action<object, object>? setAction))
{
setAction = PropertySet<TDest>.CreateSetPropertyValueAction(name);
PropertySet<TDest>.ValueFactories.Add(name, setAction);
}
setAction(entity, pk);
entity.PropertySetValue<TDest>(mColumnName, input.item_group_id);
entity.PropertySetValue<TDest>(name,pk);
entities.Add(entity);
}
}