服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-11-26 976d3ae1547b896cc5c7875408c09616d5c2ee55
Tiger.Business.MES/Common/WoContext.cs
@@ -31,11 +31,12 @@
        /// <param name="workorder"></param>
        /// <param name="lineCode"></param>
        /// <returns></returns>
        public static WorkBatch GetBatch(string workorder, string lineCode, string batchNo = "")
        public static WorkBatch GetBatch(string workorder, string lineCode, string batchNo = "", bool canDoWork = true)
        {
            if (ExistsBatch(workorder, lineCode, batchNo))
            {
                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 WoBatchDic.WhereIF(canDoWork, q => q.Value.Batch.STATUS == BIZ_MES_WO_BATCH.STATUSs.Release.GetValue() || q.Value.Batch.STATUS == BIZ_MES_WO_BATCH.STATUSs.Working.GetValue())
                    .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;
        }