本次提交为BZFM模块新增了物料管理相关的核心后端能力,包括库位、物料、物料分类、出入库记录、出入库类别等6张表的Controller、实体、DTO、Service及接口定义,实现了标准的增删改查接口,支持权限校验、AOP日志、分页查询等,完善了物料管理基础后端支撑。
79 lines
2.1 KiB
C#
79 lines
2.1 KiB
C#
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using DOAN.Model.BZFM.Dto;
|
|
using DOAN.Model.BZFM;
|
|
using DOAN.Repository;
|
|
using DOAN.Service.BZFM.IBZFMService;
|
|
|
|
namespace DOAN.Service.BZFM
|
|
{
|
|
/// <summary>
|
|
/// 物料表Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IMmMaterialService), ServiceLifetime = LifeTime.Transient)]
|
|
public class MmMaterialService : BaseService<MmMaterial>, IMmMaterialService
|
|
{
|
|
/// <summary>
|
|
/// 查询物料表列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<MmMaterialDto> GetList(MmMaterialQueryDto parm)
|
|
{
|
|
var predicate = QueryExp(parm);
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<MmMaterial, MmMaterialDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public MmMaterial GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加物料表
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public MmMaterial AddMmMaterial(MmMaterial model)
|
|
{
|
|
return Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改物料表
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateMmMaterial(MmMaterial model)
|
|
{
|
|
return Update(model, true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询导出表达式
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
private static Expressionable<MmMaterial> QueryExp(MmMaterialQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<MmMaterial>();
|
|
|
|
return predicate;
|
|
}
|
|
}
|
|
} |