服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-11-04 f4ce2bcaa377c5fe869c0e8f0e1640cee3f8a400
Tiger.Business.MES/Common/WoContext.cs
@@ -35,7 +35,7 @@
        {
            if (ExistsBatch(workorder, lineCode, batchNo))
            {
                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 WoBatchDic.FirstOrDefault(q => !q.Value.Batch.IsNullOrEmpty() && q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo)).Value;
            }
            return null;
        }
@@ -45,10 +45,13 @@
        /// </summary>
        /// <param name="workorder"></param>
        /// <param name="lineCode"></param>
        /// <param name="batchNo"></param>
        /// <param name="canDoWork"></param>
        /// <returns></returns>
        public static bool ExistsBatch(string workorder, string lineCode, string batchNo = "")
        public static bool ExistsBatch(string workorder, string lineCode, string batchNo = "", bool canDoWork = false)
        {
            return WoBatchDic.Any(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo));
            return WoBatchDic.WhereIF(canDoWork, q => !q.Value.Batch.IsNullOrEmpty() && (q.Value.Batch.STATUS == BIZ_MES_WO_BATCH.STATUSs.Release.GetValue() || q.Value.Batch.STATUS == BIZ_MES_WO_BATCH.STATUSs.Working.GetValue()))
                .Any(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo));
        }
        /// 从工单批次字典中删除一个工单批次对象
@@ -125,6 +128,7 @@
                                BATCH_NO = woSN.BATCH_NO,
                                HOLD_FLAG = "N",
                                FINISHED_FLAG = "N",
                                UNBIND_FLAG = "N",
                                INV_FLAG = "N",
                                DFT_FLAG = "N",
                                DFT_COUNT = 0,
@@ -185,6 +189,7 @@
                                BATCH_NO = woSN.BATCH_NO,
                                HOLD_FLAG = "N",
                                FINISHED_FLAG = "N",
                                UNBIND_FLAG = "N",
                                INV_FLAG = "N",
                                DFT_FLAG = "N",
                                DFT_COUNT = 0,