服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2025-01-02 7a1496993b3ecae726bbbdb2f16508c8906cde8b
Tiger.Business.MES/BIZ/BIZ_MES_WO.cs
@@ -788,7 +788,7 @@
            try
            {
                DbClient db = Biz.DataSource["YadaU9C"].Client;
                var moPickLists = db.Queryable<mes_MOPickList>().Where(q => q.MoDocNo == code).ToList();
                var moPickLists = db.Queryable<mes_MOPickList>().Where(q => q.MoDocNo == code).OrderBy(q => q.DocLineNO).ToList();
                var ids = moPickLists.Select(x => SqlFunc.ToString(x.ItemMaster)).ToList();
                var items = Biz.Db.Queryable<BAS_ITEM>().Where(q => ids.Contains(q.ID)).IncludesAllFirstLayer().ToList();
                var wo = await Biz.Db.Queryable<BIZ_MES_WO>().Where(q => q.ORDER_NO == code).IncludesAllFirstLayer().FirstAsync();
@@ -798,16 +798,25 @@
                List<WoFlowCardPrintJson> woFlowCardPrintJson = new();
                //生成打印实体
                int i = 1;
                string Model = moPickLists.Where(q => q.IssueStyleName == "推式").First()?.ItemModel;
                string MoRemark = moPickLists[0]?.MoRemark;
                string SoRemark = moPickLists[0]?.SoRemark;
                string Customer = moPickLists[0]?.Customer;
                string DemandCode = moPickLists[0]?.DemandCode;
                WoFlowCardPrintJson printJson = new()
                {
                    ID = Guid.NewGuid().ToString("N"),
                    OrderNo = code,
                    Status = wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetDesc(),
                    Model = Model,
                    ItemCode = wo.ITEM_CODE,
                    ItemDesc = wo.ItemInfo?.ITEM_DESC,
                    SapCode = wo.ItemInfo?.ExtInfo?.SapCode,
                    Qty = wo.PLAN_QTY,
                    Model = "",
                    Remark = wo.SALES_REMARK,
                    SoRemark = wo.SALES_REMARK,
                    MoRemark= MoRemark,
                    Customer = Customer,
                    DemandCode= DemandCode,
                    RouteStr = routeStr,
                    Items = new() { }
                };
@@ -816,17 +825,17 @@
                    PrintWoPickList list = new()
                    {
                        LineNo = item.DocLineNO,
                        SapCode = items.Where(q=> q.ID == SqlFunc.ToString(item.ItemMaster)).FirstOrDefault()?.ExtInfo?.SapCode,
                        SapCode = item.SapCode,
                        ItemCode = item.Code,
                        ItemDesc = items.Where(q => q.ID == SqlFunc.ToString(item.ItemMaster)).FirstOrDefault()?.ITEM_DESC,
                        PickQty = item.ActualReqQty,
                        LineRemark = "",
                        WhCode = item.BinCode,
                        WhCode07 = item.WhCode == "10107" ? item.BinCode : "",
                        LineRemark = item.Remark,
                        WhCode = item.InventoryInfoCode,
                        WhCode07 = item.PictureCode,
                        Method = item.IssueStyleName,
                    };
                    printJson.Items.Add(list);
                    if (i % 6 == 0)
                    if (i % 11 == 0)
                    {
                        woFlowCardPrintJson.Add(printJson);
                        printJson = new()
@@ -837,14 +846,20 @@
                            ItemDesc = wo.ItemInfo?.ITEM_DESC,
                            SapCode = wo.ItemInfo?.ExtInfo?.SapCode,
                            Qty = wo.PLAN_QTY,
                            Model = "",
                            Remark = wo.SALES_REMARK,
                            Model = Model,
                            MoRemark = MoRemark,
                            Customer = Customer,
                            DemandCode = DemandCode,
                            RouteStr = routeStr,
                            Items = new() { }
                        };
                    }
                    i++;
                }
                if (printJson.Items.Count > 0 )
                {
                    woFlowCardPrintJson.Add(printJson);
                }
                action.Data = woFlowCardPrintJson;
            }
            catch (Exception ex)