仓库-仓库日志功能代码提交
This commit is contained in:
93
ZR.Service/mes/wms/WmGoodsChangeLogService.cs
Normal file
93
ZR.Service/mes/wms/WmGoodsChangeLogService.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Repository;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
using System.Linq;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
|
||||
namespace ZR.Service.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// 仓库操作日志Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IWmGoodsChangeLogService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class WmGoodsChangeLogService : BaseService<WmGoodsChangeLog>, IWmGoodsChangeLogService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询仓库操作日志列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<WmGoodsChangeLogDto> GetList(WmGoodsChangeLogQueryDto parm)
|
||||
{
|
||||
DateTime searchStartTime = DateTime.Now;
|
||||
DateTime searchEndTime = DateTime.Now;
|
||||
var predicate = Expressionable.Create<WmGoodsChangeLog>()
|
||||
.AndIF(parm.Type > 0, it => it.Type == parm.Type)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Description), it => it.Description.Contains(parm.Description))
|
||||
// 当天0点
|
||||
.AndIF(DateTime.TryParse(parm.StartTimeStr,out searchStartTime), it => it.CreatedTime > searchStartTime)
|
||||
// 当天23点59分59秒
|
||||
.AndIF(DateTime.TryParse(parm.EndTimeStr, out searchEndTime), it => it.CreatedTime < searchEndTime.AddDays(1).AddTicks(-1))
|
||||
;
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<WmGoodsChangeLog, WmGoodsChangeLogDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public WmGoodsChangeLog GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加仓库操作日志
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public WmGoodsChangeLog AddWmGoodsChangeLog(WmGoodsChangeLog model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改仓库操作日志
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateWmGoodsChangeLog(WmGoodsChangeLog model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new WmGoodsChangeLog()
|
||||
//{
|
||||
// Type = model.Type,
|
||||
// Description = model.Description,
|
||||
// JsonMsg = model.JsonMsg,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user