Ver Fonte

修正超限判断逻辑并新增称重请求类

在 `CPService.cs` 文件中,修改了 `IsOutOfTolerance` 的计算逻辑,从使用与标准偏差的比较(`&&`)改为使用或的比较(`||`),以便更准确地判断称重结果是否超出容差范围。

在 `WeighingResultRequest.cs` 文件中,新增了一个名为 `WeighingResultRequest` 的类,包含了多个属性,如仓库、标准重量、称重重量、偏差上限、偏差下限和是否超限。这些属性用于表示称重结果请求的相关信息。
林豪 左 há 3 meses atrás
pai
commit
733a0822fb

+ 42 - 0
wms.dto/request/cp/WeighingResultRequest.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace wms.dto.request.cp
+{
+    /// <summary>
+    /// 称重结果请求
+    /// </summary>
+    public class WeighingResultRequest
+    {
+        /// <summary>
+        /// 仓库
+        /// </summary>
+        public string WareHouse { get; set; }
+
+        /// <summary>
+        /// 标准重量
+        /// </summary>
+        public decimal StandardWeight { get; set; }
+
+        /// <summary>
+        /// 称重重量
+        /// </summary>
+        public decimal MeasuredWeight { get; set; }
+
+        /// <summary>
+        /// 偏差上限
+        /// </summary>
+        public decimal UpperDeviationLimit { get; set; }
+
+        /// <summary>
+        /// 偏差下限
+        /// </summary>
+        public decimal LowerDeviationLimit { get; set; }
+
+        /// <summary>
+        /// 是否超限
+        /// </summary>
+        public bool IsOutOfTolerance { get; set; }
+    }
+}

+ 1 - 1
wms.service/Service/CPService.cs

@@ -4931,7 +4931,7 @@ namespace wms.service.Service
                     StandardWeight = stock.TolWQty,
                     UpperDeviationLimit = Convert.ToDecimal(config.Default1),
                     LowerDeviationLimit = Convert.ToDecimal(config.Default2),
-                    IsOutOfTolerance = request.Weight < upperDeviationLimit && request.Weight > lowerDeviationLimit ? true : false
+                    IsOutOfTolerance = request.Weight < upperDeviationLimit || request.Weight > lowerDeviationLimit ? true : false
                 };
                 _baseWeighingResult.InsertReturnEntity(weighingResult);
                 //上安灯系统