服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-10-11 545bc1c267a939cf3259afcda1ba60feedd7e7eb
Tiger.Business.MES/Common/WoContext.cs
@@ -31,11 +31,11 @@
        /// <param name="workorder"></param>
        /// <param name="lineCode"></param>
        /// <returns></returns>
        public static WorkBatch GetBatch(string workorder, string lineCode)
        public static WorkBatch GetBatch(string workorder, string lineCode, string batchNo = "")
        {
            if (ExistsBatch(workorder, lineCode))
            if (ExistsBatch(workorder, lineCode, batchNo))
            {
                return WoBatchDic.FirstOrDefault(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode).Value;
                return WoBatchDic.FirstOrDefault(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo)).Value;
            }
            return null;
        }
@@ -46,9 +46,9 @@
        /// <param name="workorder"></param>
        /// <param name="lineCode"></param>
        /// <returns></returns>
        public static bool ExistsBatch(string workorder, string lineCode)
        public static bool ExistsBatch(string workorder, string lineCode, string batchNo = "")
        {
            return WoBatchDic.Any(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode);
            return WoBatchDic.Any(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo));
        }
        /// 从工单批次字典中删除一个工单批次对象