84 lines
2.7 KiB
C#
84 lines
2.7 KiB
C#
using Infrastructure.Attribute;
|
|
using SqlSugar;
|
|
using ZR.Model;
|
|
using ZR.Model.Business;
|
|
using ZR.Model.Dto;
|
|
using ZR.Repository;
|
|
using ZR.Service.Business.IBusinessService;
|
|
|
|
namespace ZR.Service.Business
|
|
{
|
|
/// <summary>
|
|
/// 质量GP12基础标签解析Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IQcGp12BaseLabelAnalysisService), ServiceLifetime = LifeTime.Transient)]
|
|
public class QcGp12BaseLabelAnalysisService : BaseService<QcGp12BaseLabelAnalysis>, IQcGp12BaseLabelAnalysisService
|
|
{
|
|
/// <summary>
|
|
/// 查询质量GP12基础标签解析列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<QcGp12BaseLabelAnalysisDto> GetList(QcGp12BaseLabelAnalysisQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<QcGp12BaseLabelAnalysis>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<QcGp12BaseLabelAnalysis, QcGp12BaseLabelAnalysisDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public QcGp12BaseLabelAnalysis GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加质量GP12基础标签解析
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public QcGp12BaseLabelAnalysis AddQcGp12BaseLabelAnalysis(QcGp12BaseLabelAnalysis model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改质量GP12基础标签解析
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateQcGp12BaseLabelAnalysis(QcGp12BaseLabelAnalysis model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new QcGp12BaseLabelAnalysis()
|
|
//{
|
|
// Name = model.Name,
|
|
// Code = model.Code,
|
|
// Expression = model.Expression,
|
|
// Sort = model.Sort,
|
|
// Type = model.Type,
|
|
// Status = model.Status,
|
|
// Remark = model.Remark,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |