From 8893638de46547923e0684220df3d9782f7ec283 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周一, 10 3月 2025 11:01:49 +0800
Subject: [PATCH] 缓存岛需要加个批次号条件、可以选择某个批次出
---
CC/iWareCC_ASRS/Common/Helper/MyExtendHelper.cs | 96 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 95 insertions(+), 1 deletions(-)
diff --git a/CC/iWareCC_ASRS/Common/Helper/MyExtendHelper.cs b/CC/iWareCC_ASRS/Common/Helper/MyExtendHelper.cs
index c185f0c..83cb7be 100644
--- a/CC/iWareCC_ASRS/Common/Helper/MyExtendHelper.cs
+++ b/CC/iWareCC_ASRS/Common/Helper/MyExtendHelper.cs
@@ -15,7 +15,7 @@
using System.Threading;
using System.Threading.Tasks;
using XiGang.Core.Model;
-
+using LogType = iWareCommon.Utils.LogType;
namespace iWareCC.Common.Helper
{
@@ -24,6 +24,90 @@
/// </summary>
public class MyExtendHelper
{
+
+ /// <summary>
+ /// 鍏叡鐨勬帶鍒惰姹傚璞″瓧鍏�
+ /// </summary>
+ public static IDictionary<string, ControlRequest> controlRequestDicts = new Dictionary<string, ControlRequest>();
+
+ /// <summary>
+ /// 鍏叡鐨勬帶鍒惰姹傚璞″瓧鍏歌祴鍊�
+ /// </summary>
+ /// <param name="placeNo"></param>
+ /// <param name="result"></param>
+ /// <param name="msg"></param>
+ public static void SetValueControlRequestDicts(string placeNo, bool result, string msg)
+ {
+ if (controlRequestDicts.ContainsKey(placeNo))
+ {
+ controlRequestDicts[placeNo].IsSuccess = result;
+ controlRequestDicts[placeNo].LastTime = DateTime.Now;
+ controlRequestDicts[placeNo].PlaceNo = placeNo;
+ if (result)
+ {
+ controlRequestDicts[placeNo].Count = 0;
+ controlRequestDicts[placeNo].ErrMsg = "";
+ }
+ else
+ {
+ controlRequestDicts[placeNo].Count++;
+ controlRequestDicts[placeNo].ErrMsg = msg;
+ }
+ }
+ else
+ {
+ if (result)
+ {
+ controlRequestDicts.Add(placeNo, new ControlRequest()
+ {
+ PlaceNo = placeNo,
+ Count = 0,
+ LastTime = DateTime.Now,
+ ErrMsg = msg,
+ IsSuccess = result
+ });
+ }
+ else
+ {
+ controlRequestDicts.Add(placeNo, new ControlRequest()
+ {
+ PlaceNo = placeNo,
+ Count = 1,
+ LastTime = DateTime.Now,
+ ErrMsg = msg,
+ IsSuccess = result
+ });
+ }
+ }
+ }
+
+ /// <summary>
+ /// 楠岃瘉鏄惁鍏佽缁橮LC鍙戞姤璀�
+ /// </summary>
+ /// <param name="placeNo"></param>
+ /// <returns></returns>
+ public static bool ValidateIsAllowRequest(string placeNo, LogType logType)
+ {
+ if (controlRequestDicts.ContainsKey(placeNo))
+ {
+ if (controlRequestDicts[placeNo].IsSuccess == false)
+ {
+ //var diff = DateTime.Now - controlRequestDicts[placeNo].LastTime;
+ //if (diff.Seconds <= 10)
+ //{//濡傛灉杩炵画璇锋眰鍦�10绉掑唴锛屽垯璁や负 涓嶉渶瑕佸啀娆¤姹�
+ // WZ.Useful.Commons.LogTextHelper.WriteLine("CommonControl", "ValidateIsAllowRequest", "濡傛灉杩炵画璇锋眰鍦�10绉掑唴锛屽垯璁や负 涓嶉渶瑕佸啀娆¤姹傦紝闂撮殧" + diff.Seconds + "绉�,placeNo:" + placeNo);
+ // return false;
+ //}
+ if (controlRequestDicts[placeNo].Count <= 5)
+ {//濡傛灉杩炵画璇锋眰鍦�5娆″唴锛屽垯璁や负 涓嶉渶瑕佸啀娆¤姹�
+ var msg = "濡傛灉杩炵画璇锋眰鍦�5娆″唴锛屽垯璁や负 涓嶉渶瑕佸啀娆¤姹傦紝闂撮殧" + controlRequestDicts[placeNo].Count + "涓�,placeNo:" + placeNo;
+ Log4NetHelper.WriteInfoLog(logType, msg);
+ return false;
+ }
+ }
+ }
+ return true;
+ }
/// <summary>
/// 鐢熸垚鏈�鏂扮殑浠诲姟鍙�
@@ -109,7 +193,17 @@
}
order.PackageNum = packageList.Count();
order.UnLinePackageNum = packageList.Where(x => x.UpiStatus == (int)UpiStatusEnum.宸蹭笅绾�).Count();
+ if (order.UnLinePackageNum > order.PackageNum)
+ {
+ order.UnLinePackageNum = order.PackageNum;
+ }
+
order.NgPackageNum = packageList.Where(x => x.UpiStatus == (int)UpiStatusEnum.宸蹭笅绾� && x.UpiFlag == (int)UpiFlagEnum.NG).Count();
+ if (order.NgPackageNum > order.PackageNum)
+ {
+ order.NgPackageNum = order.PackageNum;
+ }
+
order.NoUnLinePackageNum = order.PackageNum - order.UnLinePackageNum;
order.AllPackageArea = packageList.Sum(x => Convert.ToDecimal(x.Info13));
--
Gitblit v1.9.3