From abf59bc386d65013b4782eb0b3af463457dbe968 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 12 三月 2024 09:23:29 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/WebAPIController.cs |   98 ++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 89 insertions(+), 9 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 3cb072b..d6ccfb0 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -143,6 +143,56 @@
             }
         }
 
+        /// <summary>
+        /// 鑷姩鑾峰彇鍩虹璧勬枡 娴佹按鍙� 灏辨槸浠g爜
+        /// </summary>
+        /// <param name="HBillType"></param>
+        /// <returns></returns>
+        [Route("Web/GetMAXNumber")]
+        [HttpGet]
+        public object GetMAXNumber(string HBillType,string HName,string TableName)
+        {
+            try
+            {
+                string HNumber = "";
+                HNumber = DBUtility.ClsPub.CreateHNumber(HBillType,HName, TableName, ref DBUtility.ClsPub.sExeReturnInfo, true);
+                //----------鍒涘缓铏氳〃------------------------
+                DataTable dt_Main = new DataTable("Json");
+                dt_Main.Columns.Add("HNumber", typeof(string));
+              
+                //---------鍒涘缓鏂拌------------------------
+                DataRow dr_main = dt_Main.NewRow();//鍒涘缓鏂拌 
+                dt_Main.Rows.Add(dr_main);//灏嗘柊琛屽姞鍏ュ埌琛ㄤ腑
+                dr_main["HNumber"] = DBUtility.ClsPub.isStrNull(HNumber);
+              
+
+                if (HNumber == null)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触";
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛";
+                    objjson.data = dt_Main;
+                    return objjson;
+                }
+            }
+            catch (Exception e)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
 
         //[Route("Web/Get_MaxBillNoAndID")]
         //[HttpGet]
@@ -8109,14 +8159,34 @@
                     return objJsonResult;
                 }
                 oCN.BeginTran();//寮�濮嬩簨鍔�
+                
                 ds = oCN.RunProcReturn("select * from Gy_ProjectMoney where HItemID=" + HItemID, "Gy_ProjectMoney");
-                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
                     objJsonResult.data = null;
-                    return objJsonResult; ;
+                    return objJsonResult;
                 }
 
 
@@ -8951,11 +9021,11 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("Select HInterID,HEquipFileNumber,HName  from Gy_EquipFileBillMain where 0=0 Order by HInterID ", "Gy_EquipFileBillMain");
+                    ds = oCN.RunProcReturn("Select HInterID,HEquipFileNumber,HName,HModel2  from Gy_EquipFileBillMain where 0=0 Order by HInterID ", "Gy_EquipFileBillMain");
                 }
                 else
                 {
-                    string sql1 = "Select HInterID,HEquipFileNumber,HName  from Gy_EquipFileBillMain where 0=0  ";
+                    string sql1 = "Select HInterID,HEquipFileNumber,HName,HModel2  from Gy_EquipFileBillMain where 0=0  ";
                     string sql = sql1 + sWhere;
                     ds = oCN.RunProcReturn(sql, "Gy_EquipFileBillMain");
                 }
@@ -9984,7 +10054,7 @@
         /// <returns></returns>
         [Route("Web/GetItemByEquipFile")]
         [HttpGet]
-        public object GetItemByEquipFile(int EquipProjectID,string Type)
+        public object GetItemByEquipFile(int EquipProjectID,string Type,string HDate)
         {
             if (EquipProjectID <= 0)
             {
@@ -10014,7 +10084,8 @@
                 }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID);
+                //string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID);
+                string sql = string.Format(@"Exec h_p_Sb_GetCheckItem_PDA '" + EquipProjectID + "','" + Type + "','" + HDate + "'");
                 ds = oCN.RunProcReturn(sql, HView);
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
@@ -10049,7 +10120,7 @@
         /// <returns></returns>
         [Route("Web/GetEquipmentBillsList")]
         [HttpGet]
-        public object GetEquipmentBillsList(string sWhere, string Type)
+        public object GetEquipmentBillsList(string sWhere, string Type,string user)
         {            
             try
             {
@@ -10064,7 +10135,7 @@
                         HView = "h_v_Sb_EquipMaintainBillList";
                         break;
                     case "WX":
-                        HView = "h_v_Sb_EquipRepairCheckBillList";
+                        HView = "h_v_Sb_EquipRepairWorkBillList";
                         break;
                     case "GZ":
                         HView = "h_v_Sb_EquipConkBookBillList";
@@ -10081,6 +10152,15 @@
                 }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl");
+                if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"])  //鏄惁绠$悊鍛�
+                {
+                    //涓嶆槸绠$悊鍛�
+                    sWhere += " and 鍒跺崟浜� = '" + user + "'";
+                }
+
+
                 string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere);
                 ds = oCN.RunProcReturn(sql, HView);
                 //娣诲姞鍒楀悕

--
Gitblit v1.9.1