From fc8149ced60fcf3e91c2012188a814ea0f55d017 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 30 十月 2024 17:55:02 +0800 Subject: [PATCH] 获取出货信息 --- Tiger.Business.MES/BIZ/BIZ_MES_WO.cs | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs b/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs index 993645e..f135d86 100644 --- a/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs +++ b/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs @@ -17,6 +17,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using System.Drawing.Printing; using System.Net.NetworkInformation; +using Tiger.Model.MES.Yada; namespace Tiger.Business.MES { @@ -481,5 +482,34 @@ } return result; } + + /// <summary> + /// 鑾峰彇鍑鸿揣淇℃伅 + /// </summary> + /// <param name="wo"></param> + /// <returns></returns> + public async Task<ApiAction> GetShipList(string wo, string orgCode) + { + var result = new ApiAction(); + try + { + DbClient db = Biz.DataSource["YadaU9C"].Client; + var org = await Biz.Db.Queryable<SYS_ORGANIZATION>().Where(q=>q.ORG_CODE == orgCode).FirstAsync(); + if (db.Queryable<mes_ShipList>().Any(q => q.MoDoc.Equals(wo) && SqlFunc.DateIsSame(q.BusinessDate, DateTime.Now) && q.Status == 2 && q.Org == org.ID.ToInt64())) + { + result.Data = "Customer"; + } + else + { + result.LocaleMsg = new($"鍑鸿揣淇℃伅瀛樺湪锛�"); + result.Data = "InStore"; + } + } + catch (Exception ex) + { + result.CatchExceptionWithLog(ex, "鑾峰彇鍑鸿揣淇℃伅寮傚父"); + } + return result; + } } } -- Gitblit v1.9.3