From 9eeda5bf9419426f96fb0441a49199c054735933 Mon Sep 17 00:00:00 2001 From: gongxh Date: Thu, 3 Jun 2021 12:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.Model/Request/Bom.cs | 4 ++++ NX.ERP.Model/Request/MomOrder.cs | 2 ++ NX.ERP.Model/Response/MOM/Bom.cs | 5 +++++ NX.ERP.Model/Response/MOM/MomDetail.cs | 1 + NX.ERP.Model/Response/MOM/MomOrder.cs | 6 +++++- NX.ERP.U8/Mom/BomDAL.cs | 18 ++++++++++++++---- NX.ERP.U8/Mom/MomOrderDAL.cs | 16 ++++++++++++---- NX.ERP.WebAPi/Web.config | 2 +- 8 files changed, 44 insertions(+), 10 deletions(-) diff --git a/NX.ERP.Model/Request/Bom.cs b/NX.ERP.Model/Request/Bom.cs index aa48ba3..6868269 100644 --- a/NX.ERP.Model/Request/Bom.cs +++ b/NX.ERP.Model/Request/Bom.cs @@ -20,8 +20,12 @@ namespace NX.ERP.Model.Request public string ParentCode { get; set; } + public long? Pubufts { get; set; } public DateTime? ModifyDate { get; set; } + + + } } diff --git a/NX.ERP.Model/Request/MomOrder.cs b/NX.ERP.Model/Request/MomOrder.cs index e181f8c..2dc816a 100644 --- a/NX.ERP.Model/Request/MomOrder.cs +++ b/NX.ERP.Model/Request/MomOrder.cs @@ -17,5 +17,7 @@ namespace NX.ERP.Model.Request public DateTime? ModifyDate { get; set; } + public long? Pubufts { get; set; } + } } diff --git a/NX.ERP.Model/Response/MOM/Bom.cs b/NX.ERP.Model/Response/MOM/Bom.cs index 02f1e18..4e9f360 100644 --- a/NX.ERP.Model/Response/MOM/Bom.cs +++ b/NX.ERP.Model/Response/MOM/Bom.cs @@ -63,6 +63,11 @@ namespace NX.ERP.Model.Response.MOM public int BomType { get; set; } + + public long pubufts { get; set; } + + public int Status { get; set; } + public string ParentCode { get; set; } public ICollection OptionComponents { get => optionComponents; set => optionComponents = value; } diff --git a/NX.ERP.Model/Response/MOM/MomDetail.cs b/NX.ERP.Model/Response/MOM/MomDetail.cs index c5ac12b..82b84f0 100644 --- a/NX.ERP.Model/Response/MOM/MomDetail.cs +++ b/NX.ERP.Model/Response/MOM/MomDetail.cs @@ -31,6 +31,7 @@ namespace NX.ERP.Model.MOM //public string BatchNo { get; set; } + public int Status { get; set; } public double Qty { get => qty; set => qty = value; } diff --git a/NX.ERP.Model/Response/MOM/MomOrder.cs b/NX.ERP.Model/Response/MOM/MomOrder.cs index 61f2f12..1583e1e 100644 --- a/NX.ERP.Model/Response/MOM/MomOrder.cs +++ b/NX.ERP.Model/Response/MOM/MomOrder.cs @@ -24,7 +24,11 @@ namespace NX.ERP.Model.MOM [Newtonsoft.Json.JsonIgnore] public ICollection Allocates { get; set; } = new List(); - + + public long Pubufts { get; set; } + + + public DateTime? ModifyDate { get; set; } diff --git a/NX.ERP.U8/Mom/BomDAL.cs b/NX.ERP.U8/Mom/BomDAL.cs index 5b65f5f..89c25f4 100644 --- a/NX.ERP.U8/Mom/BomDAL.cs +++ b/NX.ERP.U8/Mom/BomDAL.cs @@ -18,7 +18,7 @@ namespace NX.ERP.U8.Mom /// public IEnumerable GetList(string strWhere="", object Params = null) { - var strSQL = @"select ISNULL(a.ModifyDate,CreateDate) ModifyDate,a.BomId,a.Version, a.VersionDesc,a.BomType,c.InvCode as ParentCode ,' ' as id ,d.BomId, d.SortSeq, + var strSQL = @"select ISNULL(a.ModifyDate,CreateDate) ModifyDate,CONVERT(BIGINT,a.Ufts) AS pubufts,a.BomId,a.Version,a.Status, a.VersionDesc,a.BomType,c.InvCode as ParentCode ,' ' as id ,d.BomId, d.SortSeq, e.InvCode as ComponentCode ,d.BaseQtyN, d.BaseQtyD ,f.WIPType,d.EffBegDate,d.EffEndDate from bom_bom as a left join bom_parent as b on a.BomId=b.BomId left join bas_part as c on b.ParentId=c.PartId @@ -82,18 +82,28 @@ namespace NX.ERP.U8.Mom if (bom.ModifyDate!=null) { - where.Add(" ISNULL(a.ModifyDate,CreateDate) >=@ModifyDate "); + where.Add(" ISNULL(a.ModifyDate,CreateDate) >=@ModifyDate or a.RelsTime>=@ModifyDate "); } + + if (bom.Pubufts != null) + { + + where.Add("CONVERT(BIGINT,a.Ufts) >=@Pubufts "); + + } + + return this.GetList(string.Join(" and ", where.ToArray()), new { ParentCode = bom.ParentCode, VersionDesc =$"%{bom.VersionDesc}%", BomType = bom.BomType, Version =bom.Version, - bom.ModifyDate - + bom.ModifyDate, + bom.Pubufts + }); ; diff --git a/NX.ERP.U8/Mom/MomOrderDAL.cs b/NX.ERP.U8/Mom/MomOrderDAL.cs index 24998c3..ff99cad 100644 --- a/NX.ERP.U8/Mom/MomOrderDAL.cs +++ b/NX.ERP.U8/Mom/MomOrderDAL.cs @@ -21,9 +21,9 @@ namespace NX.ERP.U8.Mom using (var conn = U8LoginContext.Instance.Connection) { string strSQL = @"select - a.MoId as ProductOrderId,a.moCode as ProductOrderNo,ISNULL( ModifyDate,createDate) as ModifyDate,a.CreateDate as ProductDate,a.CreateUser as PreparedBy, + a.MoId as ProductOrderId,a.moCode as ProductOrderNo,ISNULL( ModifyDate,createDate) as ModifyDate,CONVERT(BIGINT,a.Ufts) AS pubufts,a.CreateDate as ProductDate,a.CreateUser as PreparedBy, b.MoId as id ,b.MoDId as ProductOrderDtlId,b.MoId as ProductOrderId,b.MoTypeId,d.DueDate,ISNULL( b.MDeptCode,'53') as MDeptCode,a.MoCode as ProductOrderNo, - a.CreateDate as ProductOrderDate,b.InvCode as ProductCode,b.Qty as Qty,b.SortSeq,b.SoCode, + a.CreateDate as ProductOrderDate,b.InvCode as ProductCode,b.Qty as Qty,b.SortSeq,b.SoCode,b.Status, c.AllocateId as id ,c.AllocateId as AllocateId,c.MoDId as ProductOrderDtlId,c.InvCode as MaterialCode,b.MoId as ProductOrderId, c.IssQty as IssQty,c.Qty, e.cInvSN as ID from mom_order as a @@ -101,7 +101,14 @@ namespace NX.ERP.U8.Mom if (Params.ModifyDate!=null) { - where.Add(" ISNULL( a.ModifyDate,createDate) >= @ModifyDate "); + where.Add(" ISNULL( a.ModifyDate,createDate) >= @ModifyDate or a.RelsTime>=@ModifyDate "); + } + + + if (Params.Pubufts != null) + { + where.Add("CONVERT(BIGINT,a.Ufts) >=@Pubufts "); + } @@ -110,7 +117,8 @@ namespace NX.ERP.U8.Mom ProductCode = $"%{Params.ProductCode}%", ProductOrderNo = $"{Params.ProductOrderNo}", Params.ProductOrderendID, - Params.ModifyDate + Params.ModifyDate, + Params.Pubufts }); } diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index 9e67996..432da6d 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -6,7 +6,7 @@ - +