线边库
This commit is contained in:
83
DOAN.Service/MES/Material/MaterialPartsCategoriesService.cs
Normal file
83
DOAN.Service/MES/Material/MaterialPartsCategoriesService.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.Dto;
|
||||
|
||||
using DOAN.Repository;
|
||||
using DOAN.Model.MES.material.Dto;
|
||||
using DOAN.Model.MES.material;
|
||||
using System.Linq;
|
||||
using DOAN.Service.MES.material.IService;
|
||||
|
||||
namespace DOAN.Service.MES.material
|
||||
{
|
||||
/// <summary>
|
||||
/// 北泽线边库分类Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IMaterialPartsCategoriesService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class MaterialPartsCategoriesService : BaseService<MaterialPartsCategories>, IMaterialPartsCategoriesService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询北泽线边库分类列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<MaterialPartsCategoriesDto> GetList(MaterialPartsCategoriesQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<MaterialPartsCategories>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.CategoryName),it=>it.CategoryName.Contains(parm.CategoryName))
|
||||
;
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<MaterialPartsCategories, MaterialPartsCategoriesDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="CategoryId"></param>
|
||||
/// <returns></returns>
|
||||
public MaterialPartsCategories GetInfo(int CategoryId)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.CategoryId == CategoryId)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加北泽线边库分类
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public MaterialPartsCategories AddMaterialPartsCategories(MaterialPartsCategories model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改北泽线边库分类
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateMaterialPartsCategories(MaterialPartsCategories model)
|
||||
{
|
||||
//var response = Update(w => w.CategoryId == model.CategoryId, it => new MaterialPartsCategories()
|
||||
//{
|
||||
// CategoryName = model.CategoryName,
|
||||
// CreatedAt = model.CreatedAt,
|
||||
// UpdatedAt = model.UpdatedAt,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user