83 lines
2.5 KiB
C#
83 lines
2.5 KiB
C#
using System;
|
|
using SqlSugar;
|
|
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using DOAN.Model;
|
|
using DOAN.Model.Dto;
|
|
using DOAN.Repository;
|
|
using DOAN.Service.Business.IBusinessService;
|
|
using System.Linq;
|
|
|
|
namespace DOAN.Service
|
|
{
|
|
/// <summary>
|
|
/// 追溯零件清单Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(ITraceProjectPartService), ServiceLifetime = LifeTime.Transient)]
|
|
public class TraceProjectPartService : BaseService<TraceProjectPart>, ITraceProjectPartService
|
|
{
|
|
/// <summary>
|
|
/// 查询追溯零件清单列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<TraceProjectPartDto> GetList(TraceProjectPartQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<TraceProjectPart>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<TraceProjectPart, TraceProjectPartDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public TraceProjectPart GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加追溯零件清单
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public TraceProjectPart AddTraceProjectPart(TraceProjectPart model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改追溯零件清单
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateTraceProjectPart(TraceProjectPart model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new TraceProjectPart()
|
|
//{
|
|
// ProjectCode = model.ProjectCode,
|
|
// ProductionCode = model.ProductionCode,
|
|
// ProductionName = model.ProductionName,
|
|
// Specification = model.Specification,
|
|
// Colour = model.Colour,
|
|
// HandleType = model.HandleType,
|
|
// CustomCode = model.CustomCode,
|
|
// Unit = model.Unit,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |