96 lines
3.0 KiB
C#
96 lines
3.0 KiB
C#
|
|
|
||
|
|
using Infrastructure.Attribute;
|
||
|
|
|
||
|
|
using MES_Model.Services.IMaterialService;
|
||
|
|
using MES_Model.Model.Material;
|
||
|
|
using MES_Model.Model.Material.Dto;
|
||
|
|
using MES_Model.Service;
|
||
|
|
using MES_Model.Model;
|
||
|
|
|
||
|
|
|
||
|
|
namespace MES_Model.Services.Material
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 物料清单Service业务层处理
|
||
|
|
/// </summary>
|
||
|
|
[AppService(ServiceType = typeof(IMaterialListService), ServiceLifetime = LifeTime.Transient)]
|
||
|
|
public class MaterialListService : BaseService<MaterialList>, IMaterialListService
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 查询物料清单列表
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="parm"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public PagedInfo<MaterialListDto> GetList(MaterialListQueryDto parm)
|
||
|
|
{
|
||
|
|
var predicate = Expressionable.Create<MaterialList>();
|
||
|
|
|
||
|
|
var response = Queryable()
|
||
|
|
.Where(predicate.ToExpression())
|
||
|
|
.ToPage<MaterialList, MaterialListDto>(parm);
|
||
|
|
|
||
|
|
return response;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 获取详情
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="Id"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public MaterialList GetInfo(string Id)
|
||
|
|
{
|
||
|
|
var response = Queryable()
|
||
|
|
.Where(x => x.Id == Id)
|
||
|
|
.First();
|
||
|
|
|
||
|
|
return response;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 添加物料清单
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="model"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public MaterialList AddMaterialList(MaterialList model)
|
||
|
|
{
|
||
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 修改物料清单
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="model"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public int UpdateMaterialList(MaterialList model)
|
||
|
|
{
|
||
|
|
//var response = Update(w => w.Id == model.Id, it => new MaterialList()
|
||
|
|
//{
|
||
|
|
// FkMaterialTypeCode = model.FkMaterialTypeCode,
|
||
|
|
// Name = model.Name,
|
||
|
|
// Addcode = model.Addcode,
|
||
|
|
// CustomerCode = model.CustomerCode,
|
||
|
|
// Color = model.Color,
|
||
|
|
// Specification = model.Specification,
|
||
|
|
// Unit = model.Unit,
|
||
|
|
// Description = model.Description,
|
||
|
|
// SupplierCode = model.SupplierCode,
|
||
|
|
// ExpirationUnit = model.ExpirationUnit,
|
||
|
|
// ExpirationDate = model.ExpirationDate,
|
||
|
|
// ShelfLifeWarningDays = model.ShelfLifeWarningDays,
|
||
|
|
// IsShelfLife = model.IsShelfLife,
|
||
|
|
// StartTime = model.StartTime,
|
||
|
|
// StopTime = model.StopTime,
|
||
|
|
// BarCode = model.BarCode,
|
||
|
|
// IsBatch = model.IsBatch,
|
||
|
|
// CreatedBy = model.CreatedBy,
|
||
|
|
// CreatedTime = model.CreatedTime,
|
||
|
|
// UpdatedBy = model.UpdatedBy,
|
||
|
|
// UpdatedTime = model.UpdatedTime,
|
||
|
|
//});
|
||
|
|
//return response;
|
||
|
|
return Update(model, true);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|