服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-11-27 5543c73e991dd0fb37c25365f688dc821394e09c
一些优化
已修改2个文件
16 ■■■■■ 文件已修改
Tiger.Business.MES/Transaction/Position.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Transaction/YadaPacking.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Transaction/Position.cs
@@ -675,12 +675,12 @@
                                case "GetXH":
                                    return "";
                                case "GetCardNo":
                                    return $"{Context["CurWaitShipmentCarton"].ToInt32() + 1}";
                                    return $"{Context.GetOrDefault("CurWaitShipmentCarton").ToInt32() + 1}";
                                case "GetCardTotal":
                                    var total = "";
                                    var _curaction = curAction is PackingAction ? curAction as PackingAction : null;
                                    if (!_curaction.IsNullOrEmpty()) {
                                        total = $"{Math.Ceiling(Context["CurShipQty"].ToDecimal()/_curaction.PkgRule.GetTotalQty().ToDecimal())}";
                                        total = $"{Math.Ceiling(Context.GetOrDefault("CurShipQty").ToDecimal()/_curaction.PkgRule.GetTotalQty().ToDecimal())}";
                                    }
                                    return total;
                                case "GetModelSpec": //Model+空格+SPEC,
Tiger.Business.MES/Transaction/YadaPacking.cs
@@ -399,16 +399,19 @@
                    var ship = db.Queryable<mes_ShipList>().Where(q => q.MoDoc == CurBatch.WO.ORDER_NO && q.Status == 2 && SqlFunc.DateIsSame(q.BusinessDate, DateTime.Now)).First();
                    int CurShipQty = 0;
                    int WaitShipmentCarton = 0;
                    int WaitShipment = 0;
                    if (ship.IsNullOrEmpty()) { IsPrintCustomerLabel = false; } else
                    {
                        CurShipQty = ship.ShipQty;
                        IsPrintCustomerLabel = true;
                        SugarParameter[] pars = Biz.Db.Ado.GetParameters(new { BATCH = CurBatch.Batch.BATCH_NO, NodeIdOrName = curNode.NODE_NAME });
                        var list = Biz.Db.Ado.UseStoredProcedure().GetDataTable("SP_MES_GET_NODE_BATCH_COUNT", pars).AsEnumerable().ToList();
                        if (!list.IsNullOrEmpty())
                        {
                            var batchCount = list.Where(q => q["ProdDate"].ToString() == "Whole").FirstOrDefault();
                            WaitShipmentCarton = batchCount["WaitShipment"].ToInt32();
                            IsPrintCustomerLabel = batchCount.IsNullOrEmpty() ? false : batchCount["WaitShipment"].ToInt32() >= ship.ShipQty ? false : true;
                            WaitShipmentCarton = batchCount["WaitShipmentCarton"].ToInt32();
                            WaitShipment = batchCount["WaitShipment"].ToInt32();
                            IsPrintCustomerLabel = batchCount.IsNullOrEmpty() ? IsPrintCustomerLabel : batchCount["WaitShipment"].ToInt32() >= ship.ShipQty ? false : true;
                        }
                    }
                    ShippingOrder = IsPrintCustomerLabel ? ship?.ShipDoc ?? "" : "";
@@ -424,6 +427,7 @@
                    //}
                    //缓存出货箱数
                    Context.SetOrAdd("CurWaitShipmentCarton", WaitShipmentCarton);
                    Context.SetOrAdd("CurWaitShipment", WaitShipment);
                    //if (Context.ContainsKey("CurWaitShipmentCarton"))
                    //{
                    //    Context["CurWaitShipmentCarton"] = WaitShipmentCarton;
@@ -973,7 +977,9 @@
            var action = new ApiAction<ShipingInfo>();
            try
            {
                action.Data = new ShipingInfo() { IsPrintCustomerLabel= IsPrintCustomerLabel,ShipQty = Context["CurShipQty"].ToInt32() };
                action.Data = new ShipingInfo() {
                    IsPrintCustomerLabel= IsPrintCustomerLabel,
                    ShipQty =Context.GetOrDefault("CurWaitShipment").ToInt32()>= Context.GetOrDefault("CurShipQty").ToInt32()? CurBatch.Batch.PLAN_QTY - Context.GetOrDefault("CurShipQty").ToInt32(): Context.GetOrDefault("CurShipQty").ToInt32() };
            }
            catch (Exception ex)
            {