zhuangpei-mesbackend/DOAN.Service/MES/line/MmLineTransactionLogService.cs
2025-03-21 11:14:59 +08:00

86 lines
2.7 KiB
C#

using System;
using SqlSugar;
using Infrastructure.Attribute;
using Infrastructure.Extensions;
using DOAN.Model;
using DOAN.Model.Dto;
using DOAN.Model.Business;
using DOAN.Repository;
using DOAN.Service.Business.IBusinessService;
using System.Linq;
namespace DOAN.Service.Business
{
/// <summary>
/// mm_line_transaction_logService业务层处理
/// </summary>
[AppService(ServiceType = typeof(IMmLineTransactionLogService), ServiceLifetime = LifeTime.Transient)]
public class MmLineTransactionLogService : BaseService<MmLineTransactionLog>, IMmLineTransactionLogService
{
/// <summary>
/// 查询mm_line_transaction_log列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public PagedInfo<MmLineTransactionLogDto> GetList(MmLineTransactionLogQueryDto parm)
{
var predicate = Expressionable.Create<MmLineTransactionLog>();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage<MmLineTransactionLog, MmLineTransactionLogDto>(parm);
return response;
}
/// <summary>
/// 获取详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public MmLineTransactionLog GetInfo(string Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
/// <summary>
/// 添加mm_line_transaction_log
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MmLineTransactionLog AddMmLineTransactionLog(MmLineTransactionLog model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
/// <summary>
/// 修改mm_line_transaction_log
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int UpdateMmLineTransactionLog(MmLineTransactionLog model)
{
//var response = Update(w => w.Id == model.Id, it => new MmLineTransactionLog()
//{
// TransactionType = model.TransactionType,
// MaterialCode = model.MaterialCode,
// MaterialName = model.MaterialName,
// Linecode = model.Linecode,
// Quantity = model.Quantity,
// LocationCode = model.LocationCode,
// Updatetime = model.Updatetime,
// Updateby = model.Updateby,
// Createtime = model.Createtime,
// Createby = model.Createby,
//});
//return response;
return Update(model, true);
}
}
}