84 lines
2.4 KiB
C#
84 lines
2.4 KiB
C#
|
|
|
||
|
|
|
||
|
|
using Infrastructure.Attribute;
|
||
|
|
using MES_Model.Model;
|
||
|
|
using MES_Model.Model.Material;
|
||
|
|
using MES_Model.Model.Material.Dto;
|
||
|
|
using MES_Model.Service;
|
||
|
|
using MES_Model.Services.IMaterialService;
|
||
|
|
|
||
|
|
namespace MES_Model.Services.Material
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Service业务层处理
|
||
|
|
/// </summary>
|
||
|
|
[AppService(ServiceType = typeof(IMaterialBomService), ServiceLifetime = LifeTime.Transient)]
|
||
|
|
public class MaterialBomService : BaseService<MaterialBom>, IMaterialBomService
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 查询列表
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="parm"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public PagedInfo<MaterialBomDto> GetList(MaterialBomQueryDto parm)
|
||
|
|
{
|
||
|
|
var predicate = Expressionable.Create<MaterialBom>();
|
||
|
|
|
||
|
|
var response = Queryable()
|
||
|
|
.Where(predicate.ToExpression())
|
||
|
|
.ToPage<MaterialBom, MaterialBomDto>(parm);
|
||
|
|
|
||
|
|
return response;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 获取详情
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="Id"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public MaterialBom GetInfo(string Id)
|
||
|
|
{
|
||
|
|
var response = Queryable()
|
||
|
|
.Where(x => x.Id == Id)
|
||
|
|
.First();
|
||
|
|
|
||
|
|
return response;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 添加
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="model"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public MaterialBom AddMaterialBom(MaterialBom model)
|
||
|
|
{
|
||
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 修改
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="model"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public int UpdateMaterialBom(MaterialBom model)
|
||
|
|
{
|
||
|
|
//var response = Update(w => w.Id == model.Id, it => new MaterialBom()
|
||
|
|
//{
|
||
|
|
// InvCode = model.InvCode,
|
||
|
|
// InvName = model.InvName,
|
||
|
|
// SubInvCode = model.SubInvCode,
|
||
|
|
// SubInvName = model.SubInvName,
|
||
|
|
// Iusequantity = model.Iusequantity,
|
||
|
|
// BOMVersion = model.BOMVersion,
|
||
|
|
// CreatedBy = model.CreatedBy,
|
||
|
|
// CreatedTime = model.CreatedTime,
|
||
|
|
// UpdatedBy = model.UpdatedBy,
|
||
|
|
// UpdatedTime = model.UpdatedTime,
|
||
|
|
//});
|
||
|
|
//return response;
|
||
|
|
return Update(model, true);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|