From 229a6165398cbd626cdf8a71780686c54ff9350a Mon Sep 17 00:00:00 2001
From: cnf <3200815559@qq.com>
Date: 星期一, 15 九月 2025 13:36:33 +0800
Subject: [PATCH] iqc来料检增加两个接口

---
 StandardInterface/MES.Service/service/QC/LljService.cs           |   58 +++++++++++++++++++
 StandardInterface/MESApplication/Controllers/QC/LljController.cs |   64 +++++++++++++++++++++
 2 files changed, 122 insertions(+), 0 deletions(-)

diff --git a/StandardInterface/MES.Service/service/QC/LljService.cs b/StandardInterface/MES.Service/service/QC/LljService.cs
index e907f30..c84c883 100644
--- a/StandardInterface/MES.Service/service/QC/LljService.cs
+++ b/StandardInterface/MES.Service/service/QC/LljService.cs
@@ -1095,4 +1095,62 @@
             throw new Exception(ex.Message);
         }
     }
+    public List<MesItems> GetWomdab(string daa001)
+    {
+        //if (string.IsNullOrEmpty(ItemNo))
+        //{
+        // throw new ArgumentException("妫�楠屽崟鍙蜂笉鑳戒负绌�");
+        //}
+
+        var db = SqlSugarHelper.GetInstance();
+        try
+        {
+            return db.Queryable<Womdab>()
+                    .LeftJoin<MesItems>((w, m) => w.Dab003 == m.ItemId.ToString()) // 闇�瑕佹浛鎹负瀹為檯鐨勫叧鑱斿瓧娈�
+                    .Where((w, m) => w.Dab001 == daa001)
+                    .OrderBy((w, m) => w.Dab003, OrderByType.Desc)
+                    // .ThenBy((w, m) => w.CreateDate, OrderByType.Desc)
+                    .Select((w, m) => new MesItems
+                    {
+                           ItemNo = m.ItemNo,
+                           ItemName = m.ItemName,
+                           ItemModel = m.ItemModel
+                    }).ToList();
+        }
+        catch (Exception ex)
+        {
+           throw new Exception($"鏌ヨ闄勪欢淇℃伅澶辫触: {ex.Message}");
+        }
+
+    }
+
+    public List<MesItems> GetWomdabById(string daa001,string ItemNo)
+    {
+        //if (string.IsNullOrEmpty(ItemNo))
+        //{
+        // throw new ArgumentException("妫�楠屽崟鍙蜂笉鑳戒负绌�");
+        //}
+
+        var db = SqlSugarHelper.GetInstance();
+        try
+        {
+            return db.Queryable<Womdab>()
+                    .LeftJoin<MesItems>((w, m) => w.Dab003 == m.ItemId.ToString()) // 闇�瑕佹浛鎹负瀹為檯鐨勫叧鑱斿瓧娈�
+                    .Where((w, m) => w.Dab001 == daa001 && m.ItemNo.Contains(ItemNo))
+                    .OrderBy((w, m) => w.Dab003, OrderByType.Desc)
+                    // .ThenBy((w, m) => w.CreateDate, OrderByType.Desc)
+                    .Select((w, m) => new MesItems
+                    {
+                        ItemNo = m.ItemNo,
+                        ItemName = m.ItemName,
+                        ItemModel = m.ItemModel
+                    }).ToList();
+        }
+        catch (Exception ex)
+        {
+            throw new Exception($"鏌ヨ闄勪欢淇℃伅澶辫触: {ex.Message}");
+        }
+
+    }
+
 }
\ No newline at end of file
diff --git a/StandardInterface/MESApplication/Controllers/QC/LljController.cs b/StandardInterface/MESApplication/Controllers/QC/LljController.cs
index a206bee..9da435c 100644
--- a/StandardInterface/MESApplication/Controllers/QC/LljController.cs
+++ b/StandardInterface/MESApplication/Controllers/QC/LljController.cs
@@ -476,4 +476,68 @@
         
         return Ok();
     }
+
+    [HttpPost("getWomdab")]
+    public ResponseResult getWomdab([FromBody] JObject data)
+    {
+        var daa001 = data["daa001"]?.ToString();
+        try
+        {
+            dynamic resultInfos = new System.Dynamic.ExpandoObject();
+            var tbBillList = new LljService().GetWomdab(daa001);
+            if (tbBillList == null || tbBillList.Count == 0)
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "璇ユ楠屽崟鏈笂浼犻檮浠朵俊鎭紒",
+                    data = null
+                };
+            }
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("GetWomdabById")]
+    public ResponseResult GetWomdabById([FromBody] JObject data)
+    {
+        var daa001 = data["daa001"]?.ToString();
+        var ItemNo = data["ItemNo"]?.ToString();
+        try
+        {
+            dynamic resultInfos = new System.Dynamic.ExpandoObject();
+            var tbBillList = new LljService().GetWomdabById(daa001,ItemNo);
+            if (tbBillList == null || tbBillList.Count == 0)
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "璇ユ楠屽崟鏈笂浼犻檮浠朵俊鎭紒",
+                    data = null
+                };
+            }
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
 }
\ No newline at end of file

--
Gitblit v1.9.3