物料清单修改
This commit is contained in:
parent
66c45eaf56
commit
cb46c33455
@ -74,5 +74,62 @@ namespace DOAN.Model.MES.base_.Dto
|
||||
|
||||
|
||||
|
||||
}
|
||||
public class BaseMaterialListDto2
|
||||
{
|
||||
|
||||
|
||||
public string Type_Name { get; set; }
|
||||
|
||||
public string Type_Code { get; set; }
|
||||
|
||||
public string SupplierName { get; set; }
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public int? FkTypeId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
public string CustomerCode { get; set; }
|
||||
|
||||
public string Color { get; set; }
|
||||
|
||||
public string Specification { get; set; }
|
||||
|
||||
public string Unit { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public int? FkSupplierId { get; set; }
|
||||
|
||||
public string ExpirationUnit { get; set; }
|
||||
|
||||
public decimal ExpirationDate { get; set; }
|
||||
|
||||
public int? ShelfLifeWarningDays { get; set; }
|
||||
|
||||
public int? IsShelfLife { get; set; }
|
||||
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
public DateTime? StopTime { get; set; }
|
||||
|
||||
public string BarCode { get; set; }
|
||||
|
||||
public int? IsBatch { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,7 @@ using DOAN.Repository;
|
||||
using DOAN.Service.MES.base_.IService;
|
||||
using System.Linq;
|
||||
using Mapster;
|
||||
using DOAN.Model.MES.dev.Dto;
|
||||
|
||||
namespace DOAN.Service.MES.base_
|
||||
{
|
||||
@ -23,20 +24,30 @@ namespace DOAN.Service.MES.base_
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<BaseMaterialListDto> GetList(BaseMaterialListQueryDto parm)
|
||||
public PagedInfo<BaseMaterialListDto2> GetList(BaseMaterialListQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<BaseMaterialList>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Name),it=>it.Name == parm.Name)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Code),it=>it.Code == parm.Code)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.CustomerCode),it=>it.CustomerCode == parm.CustomerCode)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Description),it=>it.Description == parm.Description)
|
||||
.AndIF(parm.FkTypeId>=0,it=>it.FkTypeId == parm.FkTypeId)
|
||||
.AndIF(parm.TimeRange!=null&&parm.TimeRange.Length==2&& parm.TimeRange[0]>DateTime.MinValue, it=>it.CreatedTime >= parm.TimeRange[0])
|
||||
.AndIF(parm.TimeRange!=null&&parm.TimeRange.Length==2&& parm.TimeRange[1]>DateTime.MinValue, it=>it.CreatedTime <= parm.TimeRange[1]) ;
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Name), it => it.Name == parm.Name)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Code), it => it.Code == parm.Code)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.CustomerCode), it => it.CustomerCode == parm.CustomerCode)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Description), it => it.Description == parm.Description)
|
||||
.AndIF(parm.FkTypeId >= 0, it => it.FkTypeId == parm.FkTypeId)
|
||||
.AndIF(parm.TimeRange != null && parm.TimeRange.Length == 2 && parm.TimeRange[0] > DateTime.MinValue, it => it.CreatedTime >= parm.TimeRange[0])
|
||||
.AndIF(parm.TimeRange != null && parm.TimeRange.Length == 2 && parm.TimeRange[1] > DateTime.MinValue, it => it.CreatedTime <= parm.TimeRange[1]);
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<BaseMaterialList, BaseMaterialListDto>(parm);
|
||||
var query01 = Queryable()
|
||||
.Where(predicate.ToExpression());
|
||||
|
||||
var response = Context.Queryable(query01).LeftJoin<BaseMaterialType>((q, t) => q.FkTypeId == t.Id)
|
||||
.LeftJoin<BaseSupplier>((q, t, s) => q.FkSupplierId == s.Id)
|
||||
.Select((q, t, s) => new BaseMaterialListDto2
|
||||
{
|
||||
|
||||
Type_Name = t.Name,
|
||||
Type_Code = t.Code,
|
||||
SupplierName = s.SupplierName
|
||||
|
||||
}, true).ToPage<BaseMaterialListDto2, BaseMaterialListDto2>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ namespace DOAN.Service.MES.base_.IService
|
||||
/// </summary>
|
||||
public interface IBaseMaterialListService : IBaseService<BaseMaterialList>
|
||||
{
|
||||
PagedInfo<BaseMaterialListDto> GetList(BaseMaterialListQueryDto parm);
|
||||
PagedInfo<BaseMaterialListDto2> GetList(BaseMaterialListQueryDto parm);
|
||||
|
||||
BaseMaterialList GetInfo(string Id);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user