From b98df034707a61fd2857dbccd5a232605076ca59 Mon Sep 17 00:00:00 2001
From: lg <123456>
Date: 星期四, 20 十一月 2025 10:26:08 +0800
Subject: [PATCH] 标准版初始化

---
 WebApi/Gs.QiTaRk/MesItemTblManager.cs |   62 +++++++++++++++++++++++++++++-
 1 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/WebApi/Gs.QiTaRk/MesItemTblManager.cs b/WebApi/Gs.QiTaRk/MesItemTblManager.cs
index c49e59e..9523718 100644
--- a/WebApi/Gs.QiTaRk/MesItemTblManager.cs
+++ b/WebApi/Gs.QiTaRk/MesItemTblManager.cs
@@ -111,7 +111,7 @@
             var dset = new DataSet();
             try
             {
-                dset = DbHelperSQL.RunProcedure("[prc_item_tbl_mx]", parameters,"0");
+                dset = DbHelperSQL.RunProcedure("[prc_item_tbl_mx]", parameters, "0");
                 if (dset != null && dset.Tables.Count > 0 &&
                     dset.Tables[0].Rows.Count > 0)
                 {
@@ -147,6 +147,7 @@
             string yy = model.yy; //鍘熷洜
             string inDaaGuid = model.inDaaGuid;//宸ュ崟
             string inOrgId = model.inOrgId;//缁勭粐
+            string _chkOut = model.chkOut;
             var _sb = new StringBuilder();
             var _split = "|";
             foreach (var m in model.list)
@@ -185,6 +186,7 @@
                         new("@inYy", yy),
                         new("@inDaaGuid", inDaaGuid),
                         new("@inOrgId", inOrgId),
+                        new("@chkOut", _chkOut),
                         new("@inEdtUserGuid", _userGuid),
                         new("@inLineList", _sb.ToString())
                     };
@@ -429,7 +431,6 @@
         {
             string _guid = mode.guid;
             string _inFieldValue = mode.inFieldValue;
-            string _chkOut=mode.chkOut;
             string _proName = "prc_item_tbl_submit";
             dynamic m = new ExpandoObject();
             m.outSum = -1;
@@ -449,7 +450,7 @@
                         new("@inEdtUserGuid", _userGuid),
                         new("@inOrderGuid", _guid),
                         new("@inFieldValue", _inFieldValue),
-                        new("@in1", _chkOut),
+                        new("@in1", ""),
                         new("@in2", "")
                     };
                         parameters[0].Direction = ParameterDirection.Output;
@@ -459,6 +460,12 @@
                         cmd.ExecuteNonQuery();
                         m.outMsg = parameters[0].Value.ToString();
                         m.outSum = int.Parse(parameters[1].Value.ToString());
+                        #region 鑷姩澶勬垚琛ユ枡鍗曟嵁
+                        if (m.outSum > 0)
+                        {
+                            autoBld(_guid);
+                        }
+                        #endregion
                     }
                     catch (Exception ex)
                     {
@@ -476,5 +483,54 @@
             }
             return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鎿嶄綔鎴愬姛锛�");
         }
+
+        /// <summary>
+        /// 鑷姩鐢熸垚琛ユ枡鍗曟嵁
+        /// </summary>
+        /// <param name="_tblGuid">閫�琛ユ枡guid</param>
+        private void autoBld(string _tblGuid)
+        {
+            dynamic m = new ExpandoObject();
+            m.outSum = -1;
+            m.outMsg = "";
+            using (var conn = new SqlConnection(DbHelperSQL.strConn))
+            {
+                using (var cmd = new SqlCommand("prc_item_tbl_submit_autoBld", conn))
+                {
+                    try
+                    {
+                        conn.Open();
+                        cmd.CommandType = CommandType.StoredProcedure;
+                        SqlParameter[] parameters =
+                        {
+                         new("@outMsg", SqlDbType.NVarChar, 2500),
+                        new("@outSum", SqlDbType.Int),
+                        new("@inEdtUserGuid", _userGuid),
+                        new("@inOrderGuid", _tblGuid),
+                        new("@inFieldValue", "1"),
+                        new("@in1", ""),
+                        new("@in2", "")
+                    };
+                        parameters[0].Direction = ParameterDirection.Output;
+                        parameters[1].Direction = ParameterDirection.Output;
+                        foreach (var parameter in parameters)
+                            cmd.Parameters.Add(parameter);
+                        cmd.ExecuteNonQuery();
+                        m.outMsg = parameters[0].Value.ToString();
+                        m.outSum = int.Parse(parameters[1].Value.ToString());
+                        LogHelper.Debug(ToString(), "prc_item_tbl_submit_autoBld error锛歰utSum:" + m.outSum + ",outMsg:" + m.outMsg);
+                    }
+                    catch (Exception ex)
+                    {
+                        LogHelper.Debug(ToString(), "prc_item_tbl_submit_autoBld error锛�"+ _tblGuid+":" + ex.Message);
+                        m.outMsg = ex.Message;
+                    }
+                    finally
+                    {
+                        conn.Close();
+                    }
+                }
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3