仓库管理_客户信息:init
This commit is contained in:
25
ZR.Service/mes/wms/IService/IWmCustomService.cs
Normal file
25
ZR.Service/mes/wms/IService/IWmCustomService.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
|
||||
namespace ZR.Service.mes.wms.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户信息service接口
|
||||
/// </summary>
|
||||
public interface IWmCustomService : IBaseService<WmCustom>
|
||||
{
|
||||
PagedInfo<WmCustomDto> GetList(WmCustomQueryDto parm);
|
||||
|
||||
WmCustom GetInfo(int Id);
|
||||
|
||||
WmCustom AddWmCustom(WmCustom parm);
|
||||
|
||||
int UpdateWmCustom(WmCustom parm);
|
||||
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -27,11 +27,21 @@ namespace ZR.Service.mes.wms
|
||||
/// <returns></returns>
|
||||
public PagedInfo<WmMaterialDto> GetList(WmMaterialQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmMaterial>();
|
||||
var predicate = Expressionable.Create<WmMaterial>()
|
||||
.AndIF(parm.Partnumber != null, it => it.Partnumber.Contains(parm.Partnumber))
|
||||
.AndIF(parm.U8InventoryCode != null, it => it.U8InventoryCode.Contains(parm.U8InventoryCode))
|
||||
.AndIF(parm.ProductName != null, it => it.ProductName.Contains(parm.ProductName))
|
||||
.AndIF(parm.Color != null, it => it.Color.Contains(parm.Color))
|
||||
.AndIF(parm.Specification != null, it => it.Specification.Contains(parm.Specification))
|
||||
.AndIF(parm.Description != null, it => it.Description.Contains(parm.Description))
|
||||
.AndIF(parm.Search1 != null, it => it.Search1.Contains(parm.Search1) || it.Search2.Contains(parm.Search1))
|
||||
.AndIF(parm.Status > -1, it => it.Status == parm.Status);
|
||||
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.Where(predicate.ToExpression()).OrderByDescending(it=>it.CreatedTime)
|
||||
.ToPage<WmMaterial, WmMaterialDto>(parm);
|
||||
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user