Files
iMES_Net/iMES.Custom/Services/Custom/Partial/Base_DefectItem_ExtendDataService.cs

62 lines
2.3 KiB
C#
Raw Permalink Normal View History

2026-02-06 18:34:35 +08:00
/*
*Base_DefectItem_ExtendData类的业务代码应在此处编写
*使repository.EF/Dapper等信息
*使repository.DbContextBeginTransaction
*使DBServerProvider.
*使UserContext.Current操作
*Base_DefectItem_ExtendDataService对增ServiceFunFilter
*/
using iMES.Core.BaseProvider;
using iMES.Core.Extensions.AutofacManager;
using iMES.Entity.DomainModels;
using System.Linq;
using iMES.Core.Utilities;
using System.Linq.Expressions;
using iMES.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using iMES.Custom.IRepositories;
namespace iMES.Custom.Services
{
public partial class Base_DefectItem_ExtendDataService
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IBase_DefectItem_ExtendDataRepository _repository;//访问数据库
[ActivatorUtilitiesConstructor]
public Base_DefectItem_ExtendDataService(
IBase_DefectItem_ExtendDataRepository dbRepository,
IHttpContextAccessor httpContextAccessor
)
: base(dbRepository)
{
_httpContextAccessor = httpContextAccessor;
_repository = dbRepository;
//多租户会用到这init代码其他情况可以不用
//base.Init(dbRepository);
}
/// <summary>
/// 获取表扩展字段
/// </summary>
/// <param name="defectItemId">不良品项编号</param>
/// <returns></returns>
public object GetExtendDataByDefectItemID()
{
return (repository.Find(x =>1 == 1, a =>
new
{
DefectItemExData_Id = a.DefectItemExData_Id,
DefectItem_Id = a.DefectItem_Id,
TableEx_Id = a.TableEx_Id,
FieldCode = a.FieldCode,
FieldName = a.FieldName,
FieldValue = a.FieldValue
})).OrderByDescending(a => a.DefectItemExData_Id)
.ThenByDescending(q => q.TableEx_Id).ToList();
}
}
}