From 779cd1aa145b8038391ba93158d476dfcf6032d9 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期四, 26 六月 2025 17:56:58 +0800
Subject: [PATCH] 优化检验方案 上偏差赋值错 优化开完工编辑后,不回传id 智云MES测试记录20250603的文档进行软件完善

---
 WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs |  173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 172 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
index f06aed1..83b8bcd 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -2417,6 +2417,31 @@
                 }
                 if (bResult)
                 {
+                    //鑷姩瀹℃牳璁剧疆
+                    if (refSav == "Add")
+                    {
+                        objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+                        //绯荤粺鍙傛暟  鑷姩瀹℃牳
+                        string sReturn = "";
+                        if (oSystemParameter.ShowBill(ref sReturn) == true)
+                        {
+                            if (oSystemParameter.omodel.OA_ErrMsgBackSignBill_AutoCheck == "Y") //绯荤粺鍙傛暟  鑷姩瀹℃牳 
+                            {
+                                objJsonResult.Verify = "Y";
+                            }
+                            else
+                            {
+                                objJsonResult.Verify = "N";
+                            }
+                        }
+                    }
+                    else
+                    if (refSav == "Update")
+                    {
+                        objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+                        objJsonResult.Verify = "N";
+                    }
+
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
@@ -3436,6 +3461,32 @@
                 }
                 if (bResult)
                 {
+
+                    //鑷姩瀹℃牳璁剧疆
+                    if (refSav == "Add")
+                    {
+                        objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+                        //绯荤粺鍙傛暟  鑷姩瀹℃牳
+                        string sReturn = "";
+                        if (oSystemParameter.ShowBill(ref sReturn) == true)
+                        {
+                            if (oSystemParameter.omodel.OA_ErrMsgBackHandleBill_AutoCheck == "Y") //绯荤粺鍙傛暟  鑷姩瀹℃牳 
+                            {
+                                objJsonResult.Verify = "Y";
+                            }
+                            else
+                            {
+                                objJsonResult.Verify = "N";
+                            }
+                        }
+                    }
+                    else
+                    if (refSav == "Update")
+                    {
+                        objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+                        objJsonResult.Verify = "N";
+                    }
+
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
@@ -4453,6 +4504,32 @@
                 }
                 if (bResult)
                 {
+
+                    //鑷姩瀹℃牳璁剧疆
+                    if (refSav == "Add")
+                    {
+                        objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+                        //绯荤粺鍙傛暟  鑷姩瀹℃牳
+                        string sReturn = "";
+                        if (oSystemParameter.ShowBill(ref sReturn) == true)
+                        {
+                            if (oSystemParameter.omodel.OA_ErrMsgBackCheckBill_AutoCheck == "Y") //绯荤粺鍙傛暟  鑷姩瀹℃牳 
+                            {
+                                objJsonResult.Verify = "Y";
+                            }
+                            else
+                            {
+                                objJsonResult.Verify = "N";
+                            }
+                        }
+                    }
+                    else
+                    if (refSav == "Update")
+                    {
+                        objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+                        objJsonResult.Verify = "N";
+                    }
+
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
@@ -7457,6 +7534,22 @@
                 concatenatedNames = string.Join(",", HNames);
                 HDescription = HDescription + "--宸插鐞�";
             }
+            else if (HHandleEmpID == 4)//鎶ュ伐鍙� 寮傚父楠屾敹  椹冲洖鎸夐挳  灏嗘秷鎭� 鍙戦�佺粰 鍙戦�佷汉锛屾帴鏀朵汉
+            {
+                //鑾峰彇鍙戦�佷汉  鎺ユ敹浜�
+                string HReceiveMan = HCopyMan;
+                string sql1 = "select HDingDingUserID 閽夐拤id from Gy_Czygl where Czymc in ('" + HSendMan + "','" + HReceiveMan + "')";
+                ds = oCN.RunProcReturn(sql1, "Gy_Czygl");
+                List<string> HNames = new List<string>();
+                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
+                {
+                    string HName = ds.Tables[0].Rows[i]["閽夐拤id"].ToString();
+                    HNames.Add(HName);
+
+                }
+                concatenatedNames = string.Join(",", HNames);
+                HDescription = HDescription + "--'"+ HSendMan + "'宸查┏鍥炴湰娆″鐞嗭紝璇�'"+ HReceiveMan + "'閲嶆柊澶勭悊";
+            }
             else
             {
                 //鏌ヨ鎸囨淳澶勭悊浜�
@@ -7565,7 +7658,14 @@
                 string sql = "select a.HSourceBillNo 娴佽浆鍗″彿,a.HSourceBillType 娴佽浆鍗$被鍨�,a.HSourceInterID 娴佽浆鍗′富鍐呯爜,a.HSourceEntryID 娴佽浆鍗″瓙鍐呯爜,b.HNumber 鐗╂枡浠g爜,b.HName 鐗╂枡鍚嶇О,b.HModel 瑙勬牸鍨嬪彿,a.HDatePlanQty 璁″垝鏁伴噺,a.HSourceID,c.HName 鐢熶骇璧勬簮 from Sc_ICMOBillStatus_Tmp a " +
                     "left join Gy_Material b on a.HMaterID=b.HItemID  left join Gy_Source c on a.HSourceID=c.HItemID where HSourceBillNo='" + HSourceBill + "' and a.HICMOStatus=1";
                 ds = oCN.RunProcReturn(sql, "Sc_ICMOBillStatus_Tmp");
-
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲搴旀纭姸鎬佸伐鍗曚俊鎭�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
                 {
@@ -7840,5 +7940,76 @@
             }
         }
         #endregion
+
+        #region 鎶ュ伐鍙� 寮傚父楠屾敹 椹冲洖澶勭悊鍗曞姛鑳�
+        [Route("Sc_MESTransFerWorkBill/BHOA_ErrMsgBackHandleBillDismiss")]
+        [HttpGet]
+        public object BHOA_ErrMsgBackHandleBillDismiss(string HInterID, string user)
+        {
+            try
+            {
+                string sql = "select HErrMsgBackInterID,HErrMsgBackEntryID,HSendMan,HDescription,HReceiveMan from OA_ErrMsgBackHandleBillMain where HErrMsgBackInterID=" + HInterID;
+                //鏇存柊寮傚父鍙嶉澶勭悊鍗曚綔搴�
+                oCN.RunProc("update OA_ErrMsgBackHandleBillMain set HBillStatus=4, HDeleteDate=GETDATE(),HDeleteMan='" + user + "'  where HErrMsgBackInterID=" + HInterID);
+                DataSet dt = oCN.RunProcReturn(sql, "OA_ErrMsgBackHandleBillMain");
+
+                //鍙嶉澶勭悊鍗曢┏鍥炲悗,鏇存柊寮傚父鍙嶉鍗曠殑鐘舵��
+                string sql1 = "update OA_ErrMsgBackBillMain set HBillStatus='13' where HInterID='" + dt.Tables[0].Rows[0]["HErrMsgBackInterID"].ToString() + "' ";
+                oCN.RunProc(sql1);
+                _ = SendDingDingAsync(dt.Tables[0].Rows[0]["HSendMan"].ToString(), 4, dt.Tables[0].Rows[0]["HDescription"].ToString(), dt.Tables[0].Rows[0]["HReceiveMan"].ToString());
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";            
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 璁惧鐐规璁板綍PDA 淇濆瓨鍚� 鏌ヨ鏄惁鏈塏G 璋冩暣瀹夌伅
+
+        [Route("Sc_MESTransFerWorkBill/getGy_EquipFile_AD")]
+        [HttpGet]
+        public object getGy_EquipFile_AD(string HInterID, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                string sql = "select * from h_v_Gy_EquipFileMainList where hmainid='" + HInterID + "'";
+                ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipFileMainList");
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1