85 lines
2.8 KiB
C#
85 lines
2.8 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.mes.wms
|
|
{
|
|
/// <summary>
|
|
/// 三楼抛光仓库Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IWmPolishWarehouseService), ServiceLifetime = LifeTime.Transient)]
|
|
public class WmPolishWarehouseService : BaseService<WmPolishWarehouse>, IWmPolishWarehouseService
|
|
{
|
|
/// <summary>
|
|
/// 查询三楼抛光仓库列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<WmPolishWarehouseDto> GetList(WmPolishWarehouseQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<WmPolishWarehouse>()
|
|
.AndIF(!string.IsNullOrEmpty(parm.Location), it => it.Location.Contains(parm.Location))
|
|
.AndIF(!string.IsNullOrEmpty(parm.Remark), it => it.Remark.Contains(parm.Remark));
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<WmPolishWarehouse, WmPolishWarehouseDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public WmPolishWarehouse GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加三楼抛光仓库
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public WmPolishWarehouse AddWmPolishWarehouse(WmPolishWarehouse model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改三楼抛光仓库
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateWmPolishWarehouse(WmPolishWarehouse model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new WmPolishWarehouse()
|
|
//{
|
|
// Location = model.Location,
|
|
// PartCapacity = model.PartCapacity,
|
|
// TankCapacity = model.TankCapacity,
|
|
// BuildCapacity = model.BuildCapacity,
|
|
// BoxPartNum = model.BoxPartNum,
|
|
// StorePartList = model.StorePartList,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |