仓库管理_客户信息:init
This commit is contained in:
91
ZR.Service/mes/wms/WmCustomService.cs
Normal file
91
ZR.Service/mes/wms/WmCustomService.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
|
||||
using ZR.Repository;
|
||||
|
||||
using System.Linq;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
|
||||
namespace ZR.Service.mes.wms
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 客户信息Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IWmCustomService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class WmCustomService : BaseService<WmCustom>, IWmCustomService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询客户信息列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<WmCustomDto> GetList(WmCustomQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmCustom>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.CustomNo), it => it.CustomNo.Contains(parm.CustomNo))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.CustomName), it => it.CustomName.Contains(parm.CustomName));
|
||||
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<WmCustom, WmCustomDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public WmCustom GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加客户信息
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public WmCustom AddWmCustom(WmCustom model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改客户信息
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateWmCustom(WmCustom model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new WmCustom()
|
||||
//{
|
||||
// CustomNo = model.CustomNo,
|
||||
// CustomName = model.CustomName,
|
||||
// CustomAddress = model.CustomAddress,
|
||||
// Remark = model.Remark,
|
||||
// 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