85 lines
2.5 KiB
C#
85 lines
2.5 KiB
C#
using Infrastructure.Attribute;
|
|
using SqlSugar;
|
|
using ZR.Model;
|
|
using ZR.Model.MES.wms;
|
|
using ZR.Model.MES.wms.Dto;
|
|
using ZR.Repository;
|
|
using ZR.Service.Business.IBusinessService;
|
|
|
|
namespace ZR.Service.Business
|
|
{
|
|
/// <summary>
|
|
/// 盘点记录Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IWmCheckLogService), ServiceLifetime = LifeTime.Transient)]
|
|
public class WmCheckLogService : BaseService<WmCheckLog>, IWmCheckLogService
|
|
{
|
|
/// <summary>
|
|
/// 查询盘点记录列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<WmCheckLogDto> GetList(WmCheckLogQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<WmCheckLog>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<WmCheckLog, WmCheckLogDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public WmCheckLog GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加盘点记录
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public WmCheckLog AddWmCheckLog(WmCheckLog model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改盘点记录
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateWmCheckLog(WmCheckLog model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new WmCheckLog()
|
|
//{
|
|
// FkGoodsNowProduction = model.FkGoodsNowProduction,
|
|
// Partnumber = model.Partnumber,
|
|
// PackageCodeClient = model.PackageCodeClient,
|
|
// OldValue = model.OldValue,
|
|
// NewValue = model.NewValue,
|
|
// Type = model.Type,
|
|
// Value = model.Value,
|
|
// Remark = model.Remark,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |