服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-11-21 9868cc20725ecd73f37e4bcfad0bac3bbb181526
Tiger.Business.MES/BIZ/BIZ_MES_WO.cs
@@ -605,22 +605,31 @@
        /// </summary>
        /// <param name="wo"></param>
        /// <returns></returns>
        public async Task<ApiAction<ShippingOutput>> GetShipList(string wo, string orgCode)
        public async Task<ApiAction<ShippingOutput>> GetShipList(ShippingInput input)
        {
            var result = new ApiAction<ShippingOutput>();
            try
            {
                DbClient db = Biz.DataSource["YadaU9C"].Client;
                var org = await Biz.Db.Queryable<SYS_ORGANIZATION>().Where(q => q.ORG_CODE == orgCode).FirstAsync();
                var org = await Biz.Db.Queryable<SYS_ORGANIZATION>().Where(q => q.ORG_CODE == input.orgCode).FirstAsync();
                string wo = input.wo;
                if (!input.SN.IsNullOrEmpty() && input.wo.IsNullOrEmpty()) {
                    var woSn = Biz.Db.Queryable<BIZ_MES_WO_SN>().Where(q => q.SN == input.SN || q.FLOW_SN == input.SN).First();
                    if (!woSn.IsNullOrEmpty()) {
                        wo = woSn.WORK_ORDER;
                    }
                }
                var ship = db.Queryable<mes_ShipList>().Where(q => q.MoDoc.Equals(wo) && q.Org == org.ID.ToInt64()).First();
                if (!ship.IsNullOrEmpty())
                {
                    result.Data = ship.BusinessDate.Date == DateTime.Now.Date ? new()
                    {
                        ShipDoc = ship.ShipDoc,
                        ShippingQty = ship.ShipQty,
                        Tag = "Customer"
                    } : new()
                    {
                        ShipDoc = ship.ShipDoc,
                        ShippingQty = ship.ShipQty,
                        Tag = "InStoreLabel"
                    };
@@ -630,6 +639,7 @@
                {
                    result.Data = new()
                    {
                        ShipDoc = "",
                        ShippingQty = 0,
                        Tag = "InStoreLabel"
                    };
@@ -706,7 +716,7 @@
                        WORK_ORDER = wo.ORDER_NO,
                        BATCH_NO = woSns[0].BATCH_NO,
                        ITEM_CODE = wo.ITEM_CODE,
                        ITEM_NAME = wo.ItemInfo?.ITEM_NAME,
                        ITEM_NAME = wo.ItemInfo?.ITEM_DESC,
                        SCAN_QTY = woSns.Count
                    },
                    ProdInBatch = new()
@@ -714,7 +724,7 @@
                        WORK_ORDER = wo.ORDER_NO,
                        BATCH_NO = woSns[0].BATCH_NO,
                        ITEM_CODE = wo.ITEM_CODE,
                        ITEM_NAME = wo.ItemInfo?.ITEM_NAME,
                        ITEM_NAME = wo.ItemInfo?.ITEM_DESC,
                        PLAN_QTY = wo.PLAN_QTY,
                        SCAN_QTY = woSns.Count
                    },