服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-12-28 4c8504f8deca450723fcdcf4f772f6cc67049c03
Tiger.Business.MES/Transaction/Position.cs
@@ -650,6 +650,10 @@
                                        {
                                            minPkgList = GetMinPkgList(_pkaction);
                                        }
                                        if (curAction is PrintInStoreLabel)
                                        {
                                            minPkgList = (curAction as PrintInStoreLabel).CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                        }
                                    }
                                    return string.Join("\r\n", minPkgList);
                                case "GetDescription":
@@ -672,6 +676,10 @@
                                        if (_action != null)
                                        {
                                            list = _action.CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                        }
                                        if (curAction is PrintInStoreLabel)
                                        {
                                            list = (curAction as PrintInStoreLabel).CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                        }
                                    }
                                    return GetHuaWeiWeek(WorkBatch.Batch.ORDER_NO, list);
@@ -706,28 +714,30 @@
                                case "GetVarByWo":
                                    return GetLabelVarWo(lv, "");
                                case "GetLOTNO":
                                    List<string> snList = new List<string>();
                                    string _lotnos = "";
                                    var _orderAction = curAction is PackingAction ? curAction as PackingAction : null;
                                    if (!CurPkg.IsNullOrEmpty())
                                    {
                                        qtylist = CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                        snList = CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                    }
                                    else
                                    {
                                        if (_orderAction != null)
                                        {
                                            var snList = _orderAction.CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                            //if (!snList.Any())
                                            {
                                                snList.Add(_orderAction.CurPkg.CustSN?.FLOW_SN);
                                            }
                                            _lotnos = string.Join(",", MainDB.Queryable<MES_CUST_SN>()
                                                .Where((q) => snList.Contains(q.FLOW_SN))
                                                .Select((q) => q.WORK_ORDER).Distinct().ToList());
                                            return _lotnos;
                                            snList = _orderAction.CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                            snList.Add(_orderAction.CurPkg.CustSN?.FLOW_SN);
                                        }
                                        if (curAction is PrintInStoreLabel)
                                        {
                                            snList = (curAction as PrintInStoreLabel).CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                            snList.Add((curAction as PrintInStoreLabel).CurPkg.CustSN?.FLOW_SN);
                                        }
                                    }
                                    return "";
                                    _lotnos = string.Join(",", MainDB.Queryable<MES_CUST_SN>()
                                        .Where((q) => snList.Contains(q.FLOW_SN))
                                        .Select((q) => q.WORK_ORDER).Distinct().ToList());
                                    return _lotnos;
                                case "GetNOTES":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo?.Remark);
                                case "GetXH":
@@ -991,20 +1001,6 @@
                list.AddRange(GetPackageList(item));
            }
            return list;
        }
        #endregion
        #region 提交前通用方法
        public async Task<ApiAction> CheckCode(string code) {
            var action = new ApiAction();
            try
            {
            }
            catch (Exception ex)
            {
                action.CatchExceptionWithLog(ex, $"检查条码{code}异常");
            }
            return action;
        }
        #endregion
        #endregion Functions