From 2a5ca0e2e98e2556bd218cade91975830e55b781 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期一, 14 四月 2025 12:16:16 +0800
Subject: [PATCH] womcaa接口表更新

---
 StandardPda/MES.Service/service/QC/LljService.cs |  122 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 105 insertions(+), 17 deletions(-)

diff --git a/StandardPda/MES.Service/service/QC/LljService.cs b/StandardPda/MES.Service/service/QC/LljService.cs
index fc972d3..77f53e7 100644
--- a/StandardPda/MES.Service/service/QC/LljService.cs
+++ b/StandardPda/MES.Service/service/QC/LljService.cs
@@ -50,15 +50,43 @@
             //    itemIds is { Length: > 0 },
             //    (a, b, c) => itemIds.Contains(a.ItemId))
             .WhereIF(id > 0, (a, b, d) => a.Id == id)
-            .WhereIF(true, (a, b, d, e, f, g) => (g.Fcode == queryObj.createUser || g.Fcode == null))
-        //鍔犵瓫閫夋潯浠�,鏍规嵁渚涘簲鍟嗭紝鐗╂枡缂栫爜锛岀墿鏂欏悕绉版悳绱�
-        //.WhereIF(queryObj.SearchValue!=null && queryObj.SearchValue!="", (a) => a.SuppName == queryObj.SearchValue|| a.ItemName == queryObj.SearchValue || a.ItemNo == queryObj.SearchValue )
-            .WhereIF(queryObj.SearchValue != null && queryObj.SearchValue != "",
-            (a, b, d) => (a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower())
-            || a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower())
-            || a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower())
-            || d.ProjectCodes.ToLower().Contains(queryObj.SearchValue.ToLower())
-            ))
+            .WhereIF(true,
+                (a, b, d, e, f, g) =>
+                    (g.Fcode == queryObj.createUser || g.Fcode == null))
+            //鍔犵瓫閫夋潯浠�,鏍规嵁渚涘簲鍟嗭紝鐗╂枡缂栫爜锛岀墿鏂欏悕绉帮紝椤圭洰鎼滅储
+            //.WhereIF(queryObj.SearchValue != null && queryObj.SearchValue != "",
+            //(a, b, d) => (a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower())
+            //|| a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower())
+            //|| a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower())
+            //|| d.ProjectCodes.ToLower().Contains(queryObj.SearchValue.ToLower())
+            //))
+
+            //鏍规嵁涓嬫媺妗嗘悳绱㈡潯浠剁瓫閫夛紙0椤圭洰, 1鐗╂枡缂栧彿, 2鐗╂枡鍚嶇О, 3渚涘簲鍟�, 4閲囪喘鍛橈級
+            .WhereIF(
+                queryObj.SelectedIndex == "0" && queryObj.SearchValue != null &&
+                queryObj.SearchValue != "",
+                (a, b, d) => (d.ProjectCodes.ToLower()
+                    .Contains(queryObj.SearchValue.ToLower())))
+            .WhereIF(
+                queryObj.SelectedIndex == "1" && queryObj.SearchValue != null &&
+                queryObj.SearchValue != "",
+                (a, b, d) => (a.ItemNo.ToLower()
+                    .Contains(queryObj.SearchValue.ToLower())))
+            .WhereIF(
+                queryObj.SelectedIndex == "2" && queryObj.SearchValue != null &&
+                queryObj.SearchValue != "",
+                (a, b, d) => (a.ItemName.ToLower()
+                    .Contains(queryObj.SearchValue.ToLower())))
+            .WhereIF(
+                queryObj.SelectedIndex == "3" && queryObj.SearchValue != null &&
+                queryObj.SearchValue != "",
+                (a, b, d) => (a.SuppName.ToLower()
+                    .Contains(queryObj.SearchValue.ToLower())))
+            .WhereIF(
+                queryObj.SelectedIndex == "4" && queryObj.SearchValue != null &&
+                queryObj.SearchValue != "",
+                (a, b, d, e) => (e.Fname.ToLower()
+                    .Contains(queryObj.SearchValue.ToLower())))
             .OrderByDescending((a, b, d) => a.Id)
             .Select((a, b, d, e, f, g) => new LtsLlj
             {
@@ -192,7 +220,13 @@
     //}
 
 
-    //鏍规嵁妫�楠屾爣鍑嗘潵璁$畻妫�楠屼釜鏁�
+    /// <summary>
+    /// 璋冪敤瀛樺偍杩囩▼锛岄噸鏂拌幏鍙栨楠岄」鐩�
+    /// </summary>
+    /// <param name="itemNo"></param>
+    /// <param name="quantity"></param>
+    /// <param name="releaseNo"></param>
+    /// <returns></returns>
     public string[] SetItems(string itemNo,
         decimal quantity, string releaseNo)
     {
@@ -209,10 +243,10 @@
         var parameters = new List<SugarParameter>
         {
             new("P_RELEASE_NO", releaseNo,
-          DbType.String, ParameterDirection.Input),
-      outputResult,
-      outputMessage
-  };
+                DbType.String, ParameterDirection.Input),
+            outputResult,
+            outputMessage
+        };
 
         var db = SqlSugarHelper.GetInstance();
 
@@ -228,10 +262,64 @@
         msg[0] = resultValue;
         msg[1] = messageValue;
         return msg;
-
-
-
     }
+
+    public string[] SaveSysSubmit(SysSubmit sysSubmit)
+    {
+        // 瀹氫箟杈撳嚭鍙傛暟
+        var outputResult = new SugarParameter("o_Result", null,
+            DbType.Int32, ParameterDirection.Output,
+            4000);
+
+        var outputMessage = new SugarParameter("o_Msg", null,
+            DbType.String,
+            ParameterDirection.Output, 4000);
+
+        // 瀹氫箟杈撳叆鍙傛暟
+        var parameters = new List<SugarParameter>
+        {
+            new("PI_BILLNO", sysSubmit.PI_BILLNO,
+                DbType.String, ParameterDirection.Input),
+            new("PI_USER", sysSubmit.PI_USER,
+                DbType.String, ParameterDirection.Input),
+            new("PI_SAMPLE_STATUS", sysSubmit.PI_SAMPLE_STATUS,
+                DbType.String, ParameterDirection.Input),
+            new("PI_SAMPLE_TYPE", sysSubmit.PI_SAMPLE_TYPE,
+                DbType.String, ParameterDirection.Input),
+            new("PI_SAMPLE_REASON", sysSubmit.PI_SAMPLE_REASON,
+                DbType.String, ParameterDirection.Input),
+            new("PI_INSPECT_TYPE", sysSubmit.PI_INSPECT_TYPE,
+                DbType.String, ParameterDirection.Input),
+            new("PI_SAMPLE_PREPARATION", sysSubmit.PI_SAMPLE_PREPARATION,
+                DbType.String, ParameterDirection.Input),
+            new("PI_URGENCY", sysSubmit.PI_URGENCY,
+                DbType.String, ParameterDirection.Input),
+            new("PI_FIRMWAREVERSION", sysSubmit.PI_FIRMWAREVERSION,
+                DbType.String, ParameterDirection.Input),
+            new("PI_HARDWAREVERSION", sysSubmit.PI_HARDWAREVERSION,
+                DbType.String, ParameterDirection.Input),
+            new("PI_REMARK", sysSubmit.PI_REMARK,
+                DbType.String, ParameterDirection.Input),
+            outputResult,
+            outputMessage
+        };
+
+        var db = SqlSugarHelper.GetInstance();
+
+        // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼
+        db.Ado.ExecuteCommand(
+            "BEGIN PRC_MES_IQC_QC_SYSSUBMIT(:PI_BILLNO,:PI_USER,:PI_SAMPLE_STATUS,:PI_SAMPLE_TYPE,:PI_SAMPLE_REASON,:PI_INSPECT_TYPE,:PI_SAMPLE_PREPARATION,:PI_URGENCY,:PI_FIRMWAREVERSION,:PI_HARDWAREVERSION,:PI_REMARK, :o_Result, :o_Msg); END;",
+            parameters.ToArray());
+
+        // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+        var resultValue = outputResult.Value?.ToString();
+        var messageValue = outputMessage.Value?.ToString();
+        string[] msg = new string[2];
+        msg[0] = resultValue;
+        msg[1] = messageValue;
+        return msg;
+    }
+
     private string ExtractSubstring(string input, char startChar, char endChar)
     {
         var startIndex = input.IndexOf(startChar);

--
Gitblit v1.9.3