From 1948124877478db58b27841f9398aed97ef13053 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期日, 26 十月 2025 17:19:15 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/基础资料/基础资料/Gy_MatePriceController.cs |   78 +++++++++++++++++++++++++++++---------
 1 files changed, 59 insertions(+), 19 deletions(-)

diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceController.cs"
index aa76936..abe0eef 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MatePriceController.cs"
@@ -28,7 +28,7 @@
             {
                 List<object> columnNameList = new List<object>();
                 //缂栬緫鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldUpperBill_Query", 1, false, user))
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Query", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -37,8 +37,7 @@
                     return objJsonResult;
                 }
                 string sql1 = string.Format(@"select * from h_v_Gy_MaterPrice where 1 = 1 ");
-
-                string sql = sql1 + sWhere;
+                string sql = sql1 + sWhere+ "order by 鍒涘缓鏃堕棿 DESC ";
                 ds = oCN.RunProcReturn(sql, "h_v_Gy_MaterPrice");
 
                 //娣诲姞鍒楀悕
@@ -76,7 +75,7 @@
             {
                 List<object> columnNameList = new List<object>();
                 //缂栬緫鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePriceSupList_Query", 1, false, user))
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Edit", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -117,15 +116,15 @@
             string msg1 = sArray[0].ToString();
             string msg2 = sArray[1].ToString();
 
-            ////缂栬緫鏉冮檺
-            //if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePriceSupList_Edit", 1, false, msg2))
-            //{
-            //    objJsonResult.code = "0";
-            //    objJsonResult.count = 0;
-            //    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
-            //    objJsonResult.data = null;
-            //    return objJsonResult;
-            //}
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Edit", 1, false, msg2))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
             ListModels oListModels = new ListModels();
 
             try
@@ -209,6 +208,8 @@
                 if (oBill.oModel.HItemID == 0)
                 {
                     bResult = oBill.AddNew();
+                    DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) from Gy_MaterPrice" , "Gy_MaterPrice");
+                    oBill.oModel.HItemID = Convert.ToInt64(Maxds.Tables[0].Rows[0][0]);
                 }
                 else
                 {
@@ -229,7 +230,7 @@
                     objJsonResult.code = "1";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
-                    objJsonResult.data = 1;
+                    objJsonResult.data = oBill.oModel.HItemID;
                     return objJsonResult;
                 }
                 else
@@ -262,7 +263,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 //鍒犻櫎鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log("Gy_MatePriceSupList_Delete", 1, false, user))
+                if (!DBUtility.ClsPub.Security_Log("Gy_MatePrice_Delete", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -319,17 +320,20 @@
         }
         #endregion
 
-
         #region 瀹℃牳銆佸弽瀹℃牳
 
         [Route("Gy_MatePriceController/MatePriceCheck")]
         [HttpGet]
         public object MatePriceCheck(int HInterID, int IsAudit, string CurUserName)
         {
+            Int64 lngBillKey = 0;
+            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+            DAL.ClsGy_MatePrice_Ctl oBill = new DAL.ClsGy_MatePrice_Ctl();
+            List<Model.ClsGy_MatePrice_Model> lsmain = new List<Model.ClsGy_MatePrice_Model>();
             try
             {
                 //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log_second("Gy_TechnologyParameterUnit_Check", 1, false, CurUserName))
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Check", 1, false, CurUserName))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -337,6 +341,42 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+                if(lngBillKey==0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                ////閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔
+                //if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁
+                //{
+                //    if (oBill.oModel.HCheckEmp.Trim() != "")
+                //    {
+                //        objJsonResult.code = "0";
+                //        objJsonResult.count = 0;
+                //        objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+                //        objJsonResult.data = null;
+                //        return objJsonResult;
+                //    }
+                //    //if (oBill.omodel.HDeleteMan.Trim() != "")
+                //    //{
+                //    //    objJsonResult.code = "0";
+                //    //    objJsonResult.count = 0;
+                //    //    objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
+                //    //    objJsonResult.data = null;
+                //    //    return objJsonResult;
+                //    //}
+                //}
+                //else
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
 
                 var ds = oCN.RunProcReturn("select * from Gy_MaterPrice where HItemID=" + HInterID, "Gy_MaterPrice");
                 if (ds.Tables[0].Rows.Count > 0)
@@ -523,7 +563,7 @@
             try
             {
                 //绂佺敤鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log_second("Gy_TechnologyParameterUnit_Stop", 1, false, CurUserName))
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_MatePrice_Stop", 1, false, CurUserName))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -704,7 +744,7 @@
             }
         }
         #endregion
-
         
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1