Compare commits

...

3 Commits

Author SHA1 Message Date
wyw
835fa8fd00 21 2026-01-20 11:05:15 +08:00
wyw
8dcbfd8bc4 2134 2026-01-20 11:04:56 +08:00
wyw
d0cb41d13d 视图 查看 2026-01-20 10:49:21 +08:00
3 changed files with 642 additions and 338 deletions

View File

@ -5,6 +5,7 @@ using APT.BaseData.Domain.IServices.BI;
using APT.BaseData.Domain.IServices.BS;
using APT.BaseData.Domain.IServices.EX;
using APT.BaseData.Domain.IServices.FM;
using APT.BaseData.Domain.IServices.OP;
using APT.BaseData.Domain.IServices.Platform;
using APT.BaseData.Services.DomainServices;
using APT.BaseData.Services.Services.AE;
@ -13,6 +14,7 @@ using APT.BaseData.Services.Services.BI;
using APT.BaseData.Services.Services.BS;
using APT.BaseData.Services.Services.EX;
using APT.BaseData.Services.Services.FM;
using APT.BaseData.Services.Services.OP;
using APT.BaseData.Services.Services.Platform;
using APT.BaseData.Services.Sys;
using Autofac;
@ -66,6 +68,7 @@ namespace APT.HM.WebApi.App_Start
builder.RegisterType<BIHomeService>().As<IBIHomeService>().InstancePerLifetimeScope();
builder.RegisterType<FMNoticeService>().As<IFMNoticeService>().InstancePerLifetimeScope();
builder.RegisterType<SENewUserService>().As<ISENewUserService>().InstancePerLifetimeScope();
builder.RegisterType<OPTenantDBConnService>().As<IOPTenantDBConnService>().InstancePerLifetimeScope();
}
}
}

View File

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Globalization;
using System.Linq;
using System.Reflection;
@ -1198,6 +1199,38 @@ namespace APT.Utility
}
return age;
}
/// <summary>
/// DataTable 转 List
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="dt"></param>
/// <returns></returns>
public static List<T> TableToList<T>(DataTable dt) where T : new()
{
List<T> ts = new List<T>();
Type type = typeof(T);
string tempName = "";
foreach (DataRow dr in dt.Rows)
{
T t = new T();
PropertyInfo[] propertys = t.GetType().GetProperties();
foreach (PropertyInfo pi in propertys)
{
tempName = pi.Name;
if (dt.Columns.Contains(tempName))
{
if (!pi.CanWrite) continue;
object value = dr[tempName];
if (value != DBNull.Value)
pi.SetValue(t, value, null);
}
}
ts.Add(t);
}
return ts;
}
}
public class BitAnd
{