|  |  | 
 |  |  |                 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) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "Exception!" + e.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region  根据树型id查找维修项目列表    | 
 |  |  | 
 |  |  |                 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")] | 
 |  |  | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                  | 
 |  |  |                     string sql1 = "Select * from Kf_StockOutRequestBillMain where 1 = 1 "; | 
 |  |  |                     string sql = sql1 + sWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "Kf_StockOutRequestBillMain"); | 
 |  |  |                     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"; | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 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"); | 
 |  |  |                 } | 
 |  |  | 
 |  |  |                     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) | 
 |  |  |             { | 
 |  |  | 
 |  |  |         #region 条件查询权限列表 | 
 |  |  |         [Route("PublicPageMethod/PowerList")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object PowerList(string czybm, string sGnbm) | 
 |  |  |         public object PowerList(string czybm, string sGnbm,string HSouceBillType) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  | 
 |  |  |                         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"; | 
 |  |  | 
 |  |  |             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( | 
 |  |  | 
 |  |  |             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 | 
 |  |  |             { | 
 |  |  | 
 |  |  |                 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 = ""; | 
 |  |  | 
 |  |  |                     } | 
 |  |  |                     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 = "授权成功!"; | 
 |  |  | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sWhere == null || sWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName  from Gy_ClassTimePrjGroup where HStopflag=0 Order by HItemID ", "Gy_ClassTimePrjGroup"); | 
 |  |  |                     ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName  from Gy_ClassTimePrj where HStopflag=0 Order by HItemID ", "Gy_ClassTimePrj"); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "Select HItemID,HNumber ,HName  from Gy_ClassTimePrjGroup where HStopflag=0  "; | 
 |  |  |                     string sql1 = "Select HItemID,HNumber ,HName  from Gy_ClassTimePrj where HStopflag=0  "; | 
 |  |  |                     string sql = sql1 + sWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrjGroup"); | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrj"); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); | 
 |  |  | 
 |  |  |         } | 
 |  |  |         #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 | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | } |