From e6e805f9c46f41b50f4a556732f618ffdb7b4e69 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 18 三月 2025 15:35:31 +0800
Subject: [PATCH] 生产领料单

---
 WebAPI/Controllers/PublicPageMethodController.cs |  256 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 218 insertions(+), 38 deletions(-)

diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index a47f0ea..d6dfe93 100644
--- a/WebAPI/Controllers/PublicPageMethodController.cs
+++ b/WebAPI/Controllers/PublicPageMethodController.cs
@@ -34,7 +34,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                    objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -108,7 +108,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -140,7 +140,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                    objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -214,7 +214,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -245,7 +245,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                    objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -319,7 +319,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -350,7 +350,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                    objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -424,7 +424,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -455,7 +455,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                    objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -529,7 +529,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -908,6 +908,35 @@
                     objJsonResult.data = ds.Tables[0];
                     return objJsonResult;
                 }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        [Route("PublicPageMethod/Gy_RepairList_PDA")]
+        [HttpGet]
+        public object Gy_RepairList_PDA(string sWhere)
+        {
+            try
+            {
+                if (sWhere != "" && sWhere != null)
+                {
+                    sWhere = "  and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+                }
+                string sql1 = string.Format(@"Select HItemID,HParentID,HNumber,HName from Gy_Repair where HStopflag=0");
+                ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "Gy_Repair");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
             }
             catch (Exception e)
             {
@@ -1365,7 +1394,37 @@
                 return objJsonResult;
             }
         }
-        #endregion
+        //鏁呴殰鍘熷洜椤甸潰浼樺寲鍚庢煡璇� 20250113
+        [Route("PublicPageMethod/Gy_ConkReasonList_PDA")]
+        [HttpGet]
+        public object List_PDA(string sWhere)
+        {
+            try
+            {
+                if (sWhere != "" && sWhere != null)
+                {
+                    sWhere = "  and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+                }
+                string sql1 = string.Format(@"Select HItemID,HParentID,HNumber,HName from Gy_ConkReason where HStopflag=0");
+                ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "Gy_ConkReason");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion        
 
         #region  鏍规嵁鏍戝瀷id鏌ユ壘鏁呴殰鍘熷洜璁剧疆鍒楄〃   
         [Route("Gy_MaintenanceMode/FaultReasonCX")]
@@ -1453,6 +1512,48 @@
                     string sql = sql1 + sWhere;
                     ds = oCN.RunProcReturn(sql, "HEquipFileNumber");
                 }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+
+        #region 鍑哄簱鐢宠鍗曟煡璇㈠垪琛�
+        [Route("OtherOutRequestBillList/CX")]
+        [HttpGet]
+        public object CX(string sWhere)
+        {
+            try
+            {
+                
+                    string sql1 = "Select * from AIS20220914133941..T_STK_OUTSTOCKAPPLY where fdocumentstatus = 'C' and FCloseStatus = 'A'";
+                   string sql2 = "order by Fdate asc";
+                 string sql = sql1 + sWhere + sql2;
+                    ds = oCN.RunProcReturn(sql, "T_STK_OUTSTOCKAPPLY");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -1919,6 +2020,33 @@
         }
         #endregion
 
+        #region 鑾峰彇鍏ㄩ儴鐗╂枡淇℃伅
+        [Route("PublicPageMethod/MaterialList")]
+        [HttpGet]
+        public object MaterialList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_KF_ICInventoryList_IF" + sWhere , "h_v_KF_ICInventoryList_IF");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region  鏍规嵁鏍戝瀷id鏌ユ壘鐗╂枡鍒楄〃   
         [Route("Gy_MaintenanceMode/PartCX")]
         [HttpGet]
@@ -2001,7 +2129,7 @@
                 }
                 else
                 {
-                    string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Unit ";
+                    string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Unit  ";
                     string sql = sql1 + sWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_IF_Unit");
                 }
@@ -2119,22 +2247,12 @@
                     string sql = sql1 + sWhere;
                     ds = oCN.RunProcReturn(sql, "Gy_Property");
                 }
-                if (ds == null || ds.Tables[0].Rows.Count == 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "false锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "Sucess锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
             }
             catch (Exception e)
             {
@@ -2228,7 +2346,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                    objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -2302,7 +2420,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -2333,7 +2451,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                    objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -2438,7 +2556,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犺缁勭粐鐨勭敤鎴锋暟鎹紒";
+                    objJsonResult.Message = "褰撳墠缁勭粐鏁版嵁鏈淮鎶わ紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -3351,7 +3469,7 @@
         #region 鏉′欢鏌ヨ鏉冮檺鍒楄〃
         [Route("PublicPageMethod/PowerList")]
         [HttpGet]
-        public object PowerList(string czybm, string sGnbm)
+        public object PowerList(string czybm, string sGnbm,string HSouceBillType)
         {
             try
             {
@@ -3367,10 +3485,17 @@
                         sName = sGnbm;
                     }
                 }
+                if (HSouceBillType == "yh")
+                {
+                    ds = oCN.RunProcReturn("select * from  Gy_Czygl where czybm='" + czybm + "'", "Gy_Czygl");
+                }
+                else if (HSouceBillType == "js")
+                {
+                    ds = oCN.RunProcReturn("select * from  System_UserGroup where GroupID='" + czybm + "'", "System_UserGroup");
+                }
 
-                ds = oCN.RunProcReturn("select * from  Gy_Czygl where czybm='" + czybm + "'", "Gy_Czygl");
                 string AuthorityID = ClsPub.isStrNull(ds.Tables[0].Rows[0]["AuthorityID"]);
-                ds = oCN.RunProcReturn("SELECT id hid,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityID,'' AuthorityHID, gnms ,gnbm hgnbm FROM  xt_xtgnb where useflag=1 and sjgnbm='" + sName + "'  and rightflag=1  order by gnbm", "xt_xtgnb");
+                ds = oCN.RunProcReturn("SELECT id hid,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityID,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityHID, gnms ,gnbm hgnbm FROM  xt_xtgnb where useflag=1 and sjgnbm='" + sName + "'  and rightflag=1  order by gnbm", "xt_xtgnb");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -3407,7 +3532,7 @@
             SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN();
             string sql = string.Format(@"select '鏉冮檺绠$悊-鐢ㄦ埛' id,'' HNumber,'鏉冮檺绠$悊--鐢ㄦ埛' title,'' ParentID
                                          union all
-                                         select gnbm id,gnsy HNumber,gnmc as title, case when sjgnbm='' then '鏉冮檺绠$悊--鐢ㄦ埛' else sjgnbm end  ParentID  from Xt_Xtgnb where sjgnbm=''
+                                         select gnbm id,gnsy HNumber,gnmc as title, case when sjgnbm='' then '鏉冮檺绠$悊--鐢ㄦ埛' else sjgnbm end  ParentID  from Xt_Xtgnb where sjgnbm=''  and useflag=1
                                          union all
                                          Select gnbm id,gnsy HNumber,gnmc as title,sjgnbm as ParentID
                                          from Xt_Xtgnb  where mjbz=0 and useflag=1 and rightflag=1 and sjgnbm in(
@@ -3444,6 +3569,7 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
+            string HSouceBillType = sArray[3].ToString();
             ListModels oListModels = new ListModels();
             try
             {
@@ -3452,7 +3578,16 @@
                 msg3 = msg3.Replace("\\", "");
                 msg3 = msg3.Replace("\n", "");  //\n
                 lsmain = oListModels.getObjectByJson_UserPower(msg3);
-                ds = oCN.RunProcReturn("select * from  Gy_Czygl where czybm='" + msg4.Trim() + "'", "Gy_Czygl");
+
+                if (HSouceBillType == "yh")
+                {
+                    ds = oCN.RunProcReturn("select * from  Gy_Czygl where czybm='" + msg4.Trim() + "'", "Gy_Czygl");
+                }
+                else if (HSouceBillType == "js")
+                {
+                    ds = oCN.RunProcReturn("select * from  System_UserGroup where GroupID='" + msg4 + "'", "System_UserGroup");
+                }
+              
                 string AuthorityID = ClsPub.isStrNull(ds.Tables[0].Rows[0]["AuthorityID"]);
                 string Auth_str = AuthorityID;
                 string MKID = "";
@@ -3506,7 +3641,16 @@
                     }
                     oDs = null;
                 }
-                oCN.RunProc("UPDATE  Gy_Czygl SET AuthorityID='" + Auth_str + "' WHERE czybm='" + msg4.Trim() + "'");
+
+                if (HSouceBillType == "yh")
+                {
+                    oCN.RunProc("UPDATE  Gy_Czygl SET AuthorityID='" + Auth_str + "' WHERE czybm='" + msg4.Trim() + "'");
+                }
+                else if (HSouceBillType == "js")
+                {
+                    oCN.RunProc("UPDATE  System_UserGroup SET AuthorityID='" + Auth_str + "' WHERE GroupID='" + msg4.Trim() + "'");
+                }
+              
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鎺堟潈鎴愬姛锛�";
@@ -3627,5 +3771,41 @@
         }
         #endregion
 
+        #region 閫夋嫨宸ュ簭鍩虹璧勬枡
+        [Route("PublicPageMethod/ProcessList")]
+        [HttpGet]
+        public object ProcessList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Process " + sWhere + " Order by HItemID", "Gy_Process");
+                //if (ds == null || ds.Tables[0].Rows.Count == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "false锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //else
+                //{
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+                //}
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }

--
Gitblit v1.9.1