ke_junjie
2025-06-04 84620534eb627e95811b971a4b552b6a177829bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using iWare.Wms.Core.Util.LowCode.Dto;
using Furion.DatabaseAccessor;
using Mapster;
 
namespace iWare.Wms.Core.Util.LowCode
{
    public static class SysFileServiceEx
    {
        public static List<Front_FileDto> GetFiles(this string fileid, IRepository<SysFile> repository)
        {
            List<Front_FileDto> data = new List<Front_FileDto>();
 
            if (string.IsNullOrWhiteSpace(fileid)) return data;
 
            foreach (var id in fileid.Split(','))
            {
                if (long.TryParse(id, out long val))
                {
                    data.Add(repository.Where(x => x.Id == val).ProjectToType<Front_FileDto>().FirstOrDefault());
                }
            }
 
            return data;
        }
    }
}