服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
16 小时以前 77da8b9247b9df926678cfb7e4af0f0900f3a084
Tiger.Business.WMS/Common/WmsTask.cs
@@ -358,9 +358,9 @@
                                            //如果有传入货架,则只允该货架的物料
                                            .WhereIF(!option.ShelfID.IsNullOrEmpty(), (q, p, w, r, s, l) => q.SHELF_ID == option.ShelfID && q.AUTH_ORG == auth.CurOrg)
                                            //优先使用库存池中的物料
                                            .OrderBy((q, p, w, r, s, l) => SqlFunc.IsNullOrEmpty(p.ID))
                                            .OrderBy((q, p, w, r, s, l) => SqlFunc.IIF(SqlFunc.IsNullOrEmpty(p.ID), 1, 0))
                                            //优先使用尾数物料(截料或者退料之后的物料)
                                            //.OrderByDescending((q, p, w, r, s, l) => q.SN.Contains("_C") || q.SN.Contains("_T"))
                                            //.OrderByDescending((q, p, w, r, s, l) => SqlFunc.IIF(q.SN.Contains("_C") || q.SN.Contains("_T"), 1, 0))
                                            //备料策略:按生产日期先进先出
                                            .OrderByIF(option.Strategy.HasFlag(WMS_ITEM_POOL.STRATEGYs.FIFO), (q, p, w, r, s, l) => q.PROD_DATE)
                                            //按生产日期先进先出,再按物料数量从小到大,
@@ -392,11 +392,11 @@
                    result.Flag = Result.Flags.Warning;
                    result.LocaleMsg = new("WMS.WmsItem.Suggest.Warning", total);
                }
                //if (total == 0)
                //{
                //    result.Flag = Result.Flags.Failed;
                //    result.LocaleMsg = new("WMS.WmsItem.Suggest.Failed");
                //}
                if (total == 0)
                {
                    result.Flag = Result.Flags.Failed;
                    result.LocaleMsg = new("WMS.WmsItem.Suggest.Failed");
                }
            }
            catch (Exception ex)
            {
@@ -444,9 +444,9 @@
                                            //如果有传入货架,则只允该货架的物料
                                            .WhereIF(!option.ShelfID.IsNullOrEmpty(), (q, p, w, r, s, l) => q.SHELF_ID == option.ShelfID && q.AUTH_ORG == auth.CurOrg)
                                            //优先使用库存池中的物料
                                            .OrderBy((q, p, w, r, s, l) => SqlFunc.IsNullOrEmpty(p.ID))
                                            .OrderBy((q, p, w, r, s, l) => SqlFunc.IIF(SqlFunc.IsNullOrEmpty(p.ID), 1, 0))
                                            //优先使用尾数物料(截料或者退料之后的物料)
                                            //.OrderByDescending((q, p, w, r, s, l) => q.SN.Contains("_C") || q.SN.Contains("_T"))
                                            //.OrderByDescending((q, p, w, r, s, l) => SqlFunc.IIF(q.SN.Contains("_C") || q.SN.Contains("_T"), 1, 0))
                                            //备料策略:按生产日期先进先出
                                            .OrderByIF(option.Strategy.HasFlag(WMS_ITEM_POOL.STRATEGYs.FIFO), (q, p, w, r, s, l) => q.PROD_DATE)
                                            //按生产日期先进先出,再按物料数量从小到大,
@@ -513,11 +513,12 @@
                    result.Flag = Result.Flags.Warning;
                    result.LocaleMsg = new("WMS.WmsItem.Suggest.Warning", totalQty);
                }
                //if (totalQty == 0)
                //{
                //    result.Flag = Result.Flags.Failed;
                //    result.LocaleMsg = new("WMS.WmsItem.Suggest.Failed");
                //}
                if (totalQty == 0)
                {
                    result.Flag = Result.Flags.Failed;
                    //result.LocaleMsg = new("物料下架推荐失败:库存中找不到可以下架的物料");
                    result.LocaleMsg = new("WMS.WmsItem.Suggest.Failed");
                }
            }
            catch (Exception ex)
            {
@@ -620,6 +621,7 @@
            var result = new Result(Result.Flags.Success);
            try
            {
                var newItems = new List<WMS_ITEM>();
                foreach (var item in CurInvItem.Items)
                {
                    var sn = snList.First(q => q.SN == item.SN);
@@ -662,7 +664,7 @@
                            META_SN = newItem.SN,
                        });
                        CurInvItem.Items.Add(newItem);
                        newItems.Add(newItem);
                        CurInvItem.History.Add(his);
                        CurInvItem.Packages.Add(newPkg);
                    }
@@ -685,6 +687,7 @@
                        CurInvItem.History.Add(new WMS_ITEM_HIS(item, $"条码[{CurInvItem.SN}]从储位[{CurInvItem?.Location?.LOCATION_CODE}]发料下架成功,状态[{item.STATUS.GetEnumDesc<WMS_ITEM.STATUSs>()}],操作单据[{item.TRANS_NO}]"));
                    }
                }
                CurInvItem.Items.AddRange(newItems);
                CurInvItem.Packages = WMS_ITEM_PKG.UpdateQty(CurInvItem.Packages);
                //创建变量克隆对象用于传入DBSubmitAction中保存当前需要暂存的数据值