From a665d97372e185d985da820526de9d1d0389c728 Mon Sep 17 00:00:00 2001 From: qian Date: Mon, 7 Apr 2025 18:25:01 +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 --- Controller/SCP_PO_CONTROLLER.cs | 7 ++----- Models/ScpEntities.cs | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Controller/SCP_PO_CONTROLLER.cs b/Controller/SCP_PO_CONTROLLER.cs index a4cbd06..b53021d 100644 --- a/Controller/SCP_PO_CONTROLLER.cs +++ b/Controller/SCP_PO_CONTROLLER.cs @@ -9473,7 +9473,6 @@ namespace CK.SCP.Controller { var _entity = db.V_TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault(); - var detail = db.TB_MAXPO_DETAIL.First(p => p.UID == itm.UID); if (Math.Abs( (itm.ReductionQty * 1000).Value) > _entity.SurplusQty) { _ret.MessageList.Add("零件号" + _entity.PartCode + "单次削减量不能大于剩余订货量(千克)"); @@ -9493,9 +9492,7 @@ namespace CK.SCP.Controller else { - detail.OrderQtykg = (_entity.OrderQtydNow + itm.ReductionQty.Value) * 1000; - //_entity.AsnQty = (itm.ReductionQty * 1000 + _entity.AsnQty).Value; - detail.SurplusQty = (itm.ReductionQty.Value * 1000 + detail.SurplusQty); + var detail = db.TB_MAXPO_DETAIL.First(p => p.UID == itm.UID); if (detail.ReductionQtyOne == null) { detail.ReductionQtyOne = itm.ReductionQty; @@ -9521,7 +9518,7 @@ namespace CK.SCP.Controller } _entity.OrderQtykg = (_entity.OrderQtydNow + itm.ReductionQty.Value) * 1000; //_entity.AsnQty = (itm.ReductionQty * 1000 + _entity.AsnQty).Value; - _entity.SurplusQty = (itm.ReductionQty * 1000 + detail.SurplusQty).Value; + _entity.SurplusQty = (itm.ReductionQty * 1000 + _entity.SurplusQty).Value; // 修改数据 TS_UNI_API maxuni = new TS_UNI_API(); maxuni.BillNum = _entity.PoBillNum; diff --git a/Models/ScpEntities.cs b/Models/ScpEntities.cs index c80a8fd..7c11291 100644 --- a/Models/ScpEntities.cs +++ b/Models/ScpEntities.cs @@ -372,6 +372,8 @@ namespace CK.SCP.Models .Property(e => e.SurplusQty).HasPrecision(18, 6); modelBuilder.Entity() .Property(e => e.OrderQtykg).HasPrecision(18, 6); + modelBuilder.Entity() + .Property(e => e.MinordQty).HasPrecision(18, 6); } } }