|
|
using Sln.Wcs.Model.Domain;
|
|
|
using Sln.Wcs.Repository.service.@base;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Linq.Expressions;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
#region << 版 本 注 释 >>
|
|
|
/*--------------------------------------------------------------------
|
|
|
* 版权所有 (c) 2026 WenJY 保留所有权利。
|
|
|
* CLR版本:4.0.30319.42000
|
|
|
* 机器名称:T14-GEN3-7895
|
|
|
* 命名空间:Sln.Wcs.Repository.service.Impl
|
|
|
* 唯一标识:6990ddb2-4013-42e6-b721-ef9ae41bcf70
|
|
|
*
|
|
|
* 创建者:WenJY
|
|
|
* 电子邮箱:
|
|
|
* 创建时间:2026-03-25 16:31:19
|
|
|
* 版本:V1.0.0
|
|
|
* 描述:
|
|
|
*
|
|
|
*--------------------------------------------------------------------
|
|
|
* 修改人:
|
|
|
* 时间:
|
|
|
* 修改说明:
|
|
|
*
|
|
|
* 版本:V1.0.0
|
|
|
*--------------------------------------------------------------------*/
|
|
|
#endregion << 版 本 注 释 >>
|
|
|
namespace Sln.Wcs.Repository.service.Impl
|
|
|
{
|
|
|
public class BaseDeviceInfoServiceImpl : BaseServiceImpl<BaseDeviceInfo>, IBaseDeviceInfoService
|
|
|
{
|
|
|
public BaseDeviceInfoServiceImpl(Repository<BaseDeviceInfo> rep) : base(rep)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
public List<BaseDeviceInfo> GetDeviceInfos(Expression<Func<BaseDeviceInfo, bool>> exp)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
var res = _rep.Context.Queryable<BaseDeviceInfo>()
|
|
|
.Includes(x => x.deviceParams) // 先加载所有
|
|
|
.Where(exp)
|
|
|
.ToList()
|
|
|
.Select(device => new BaseDeviceInfo()
|
|
|
{
|
|
|
objId = device.objId,
|
|
|
deviceCode = device.deviceCode,
|
|
|
deviceName = device.deviceName,
|
|
|
deviceType = device.deviceType,
|
|
|
deviceStatus = device.deviceStatus,
|
|
|
hostCode = device.hostCode,
|
|
|
isFlag = device.isFlag,
|
|
|
remark = device.remark,
|
|
|
deviceParams = device.deviceParams.AsQueryable()
|
|
|
//.Where(detailWhere) // 应用子表查询条件
|
|
|
.Where(p => p.isFlag == 1)
|
|
|
.ToList()
|
|
|
}).ToList();
|
|
|
|
|
|
return res;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
throw new InvalidOperationException($"通过导航查询方式获取设备信息及下属参数执行异常:{ex.Message}");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|