| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Customer "+ sWhere + " Order by HItemID ", "h_v_IF_Customer"); |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Customer " + sWhere + " Order by HItemID ", "h_v_IF_Customer"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Customer " + sWhere+"", "h_v_IF_Customer"); |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Customer " + sWhere + "", "h_v_IF_Customer"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Emp "+sWhere+" Order by HItemID ", "h_v_IF_Emp"); |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Emp " + sWhere + " Order by HItemID ", "h_v_IF_Emp"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Emp " + sWhere+"", "h_v_IF_Emp"); |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Emp " + sWhere + "", "h_v_IF_Emp"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Warehouse "+sWhere+" Order by HItemID ", "h_v_IF_Warehouse"); |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Warehouse " + sWhere + " Order by HItemID ", "h_v_IF_Warehouse"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Warehouse "+sWhere+"", "h_v_IF_Warehouse"); |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Warehouse " + sWhere + "", "h_v_IF_Warehouse"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_StockPlace "+sWhere+" Order by HItemID ", "Gy_StockPlace"); |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_StockPlace " + sWhere + " Order by HItemID ", "Gy_StockPlace"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_StockPlace "+sWhere+"", "Gy_StockPlace"); |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_StockPlace " + sWhere + "", "Gy_StockPlace"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Department "+sWhere+" Order by HItemID ", "h_v_IF_Department"); |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Department " + sWhere + " Order by HItemID ", "h_v_IF_Department"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Department "+sWhere+"", "h_v_IF_Department"); |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Department " + sWhere + "", "h_v_IF_Department"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName,HModel from h_v_Gy_Mould Order by HNumber", "h_v_Gy_Mould"); |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName,HModel,HDesignLife,HUseLife,HLeaveLife from h_v_Gy_Mould Order by HNumber", "h_v_Gy_Mould"); |
| | | } |
| | | else |
| | | { |
| | |
| | | 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) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Supplier "+sWhere+" Order by HItemID", "Gy_Supplier"); |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Supplier " + sWhere + " Order by HItemID", "Gy_Supplier"); |
| | | //if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | |
| | | //} |
| | | //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) |
| | |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_Supplier "+sWhere+"", "Gy_Supplier"); |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Gy_Supplier " + sWhere + "", "Gy_Supplier"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | 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")] |
| | |
| | | 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"; |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName,HModel from h_v_IF_Material "+sWhere+" Order by HItemID", "h_v_IF_Material"); |
| | | 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; |
| | | } |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName,HModel from h_v_IF_Material " + sWhere + " Order by HItemID", "h_v_IF_Material"); |
| | | |
| | | 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("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) |
| | | { |
| | |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Material "+sWhere+"", "h_v_IF_Material"); |
| | | ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from h_v_IF_Material " + sWhere + "", "h_v_IF_Material"); |
| | | 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) |
| | | { |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无该组织的用户数据!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | #region 条件查询权限列表 |
| | | [Route("PublicPageMethod/PowerList")] |
| | | [HttpGet] |
| | | public object PowerList(string czybm,string sGnbm) |
| | | public object PowerList(string czybm, string sGnbm,string HSouceBillType) |
| | | { |
| | | try |
| | | { |
| | | string sName = ""; |
| | | if (sGnbm != "" && sGnbm != null) |
| | | { |
| | | sName = sGnbm.Substring(1, sGnbm.Length - 1); |
| | | if (sGnbm == "权限管理-用户") |
| | | { |
| | | sName = ""; |
| | | } |
| | | else |
| | | { |
| | | sName = sGnbm; |
| | | } |
| | | } |
| | | ds = oCN.RunProcReturn("select * from Gy_Czygl where czybm='" + czybm + "'", "Gy_Czygl"); |
| | | 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"); |
| | | } |
| | | |
| | | 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 是否权限,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"; |
| | |
| | | public object PowerLoadTree() |
| | | { |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | string sql = string.Format(@"select 'T权限管理-用户' id,'' HNumber,'权限管理--用户' title,'' ParentID, 'true' spread |
| | | string sql = string.Format(@"select '权限管理-用户' id,'' HNumber,'权限管理--用户' title,'' ParentID |
| | | union all |
| | | Select 'T'+gnbm id,gnsy HNumber,gnmc as title,case when sjgnbm<>null then sjgnbm else 'T权限管理-用户' end ParentID, 'true' spread |
| | | from Xt_Xtgnb where useflag=1 and rightflag=1 and (gnbm NOT LIKE '99%') and sjgnbm='' and mjbz=0 "); |
| | | 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( |
| | | select gnbm from Xt_Xtgnb where mjbz=0 and useflag=1 and rightflag=1 |
| | | ) "); |
| | | ds = oCN.RunProcReturn(sql, "Xt_Xtgnb"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 用户关联权限提交 |
| | | [Route("Gy_MaintenanceMode/SaverPower")] |
| | | [HttpPost] |
| | | public object SaverPower([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | 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 |
| | | { |
| | | List<Models.UserPower> lsmain = new List<Models.UserPower>(); |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_UserPower(msg3); |
| | | |
| | | 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 = ""; |
| | | int lENSTR = 0; //模块ID |
| | | DataSet oDs = new DataSet(); |
| | | for (int i = 0; i < lsmain.Count; i++) |
| | | { |
| | | MKID = ClsPub.isStrNull(lsmain[i].hid); |
| | | lENSTR = ClsPub.isInt(MKID.Substring(0, MKID.Length)); |
| | | if (lsmain[i].AuthorityHID == "1") |
| | | { |
| | | for (int h = Auth_str.Trim().Length; h <= lENSTR - 1; h++) |
| | | { |
| | | Auth_str = Auth_str.Trim() + "0"; |
| | | } |
| | | |
| | | Auth_str = Auth_str.Substring(0, lENSTR - 1) + "1" + Auth_str.Substring(lENSTR, Auth_str.Length - lENSTR); |
| | | } |
| | | else |
| | | { |
| | | if (Auth_str.Length >= lENSTR) |
| | | { |
| | | Auth_str = Auth_str.Substring(0, lENSTR - 1) + "0" + Auth_str.Substring(lENSTR, Auth_str.Length - lENSTR); |
| | | } |
| | | } |
| | | oDs = oCN.RunProcReturn("select * from xt_xtgnb where useflag=1 and gnbm like '" + lsmain[i].hgnbm + "%'", "xt_xtgnb"); |
| | | if (oDs.Tables[0].Rows.Count != 0) |
| | | { |
| | | for (int k = 0; k < oDs.Tables[0].Rows.Count; k++) |
| | | { |
| | | int ID = ClsPub.isInt(oDs.Tables[0].Rows[k]["id"]); |
| | | if (lsmain[i].AuthorityHID == "1") |
| | | { |
| | | if (lsmain[i].AuthorityHID == "1") |
| | | { |
| | | for (int h = Auth_str.Trim().Length; h <= ID - 1; h++) |
| | | { |
| | | Auth_str = Auth_str.Trim() + "0"; |
| | | } |
| | | Auth_str = Auth_str.Substring(0, ID - 1) + "1" + Auth_str.Substring(ID, Auth_str.Length - ID); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (Auth_str.Length >= ID) |
| | | { |
| | | Auth_str = Auth_str.Substring(0, ID - 1) + "0" + Auth_str.Substring(ID, Auth_str.Length - ID); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | oDs = null; |
| | | } |
| | | |
| | | 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 = "授权成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = e.Message; |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 用户穿梭框查询列表 |
| | | [Route("PublicPageMethod/PeopleTransFerList")] |
| | | [HttpGet] |
| | | public object PeopleTransFerList() |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("Select czybm value,czymc title from h_v_Gy_UserList Order by czybm ", "h_v_Gy_UserList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无用户数据!"; |
| | | 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 获取核算方式列表 |
| | | /// <summary> |
| | | /// 获取核算方式列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("PublicPageMethod/GetClassTimePrjList_Json")] |
| | | [HttpGet] |
| | | public object GetClassTimePrjList_Json(string Gy_ClassTimePrj) |
| | | { |
| | | string sWhere = ""; |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1"; |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | if (Gy_ClassTimePrj != "") |
| | | { |
| | | sWhere = sWhere + " and ( HNumber like '%" + Gy_ClassTimePrj + "%' or HName like '%" + Gy_ClassTimePrj + "%' ) "; |
| | | } |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | 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_ClassTimePrj where HStopflag=0 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrj"); |
| | | } |
| | | |
| | | //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "获取失败" + DBUtility.ClsPub.sErrInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取成功"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "获取失败" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #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 |
| | | |
| | | } |
| | | } |