| | |
| | | using System; |
| | | using DBUtility; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using System.Web.UI.WebControls; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers |
| | |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Customer where HStopflag=0 Order by HItemID ", "h_v_IF_Customer"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Customer where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_Emp"); |
| | | } |
| | | 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 = "false!"; |
| | | 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", "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 = "false!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 选择用户基础资料 |
| | | #region 选择职员基础资料 |
| | | |
| | | #region 条件查询用户列表 |
| | | #region 条件查询职员列表 |
| | | [Route("PublicPageMethod/UserList")] |
| | | [HttpGet] |
| | | public object UserList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Emp where HStopflag=0 Order by HItemID ", "h_v_IF_Emp"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Emp where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "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 = "false!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 根据树型id查找用户列表 |
| | | #region 根据树型id查找职员列表 |
| | | [Route("Gy_MaintenanceMode/UserCX")] |
| | | [HttpGet] |
| | | public object UserCX(long HInterID) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 树型列表用户列表数据 |
| | | #region 树型列表职员列表数据 |
| | | [Route("Gy_MaintenanceMode/UserLoadTree")] |
| | | [HttpGet] |
| | | public object UserLoadTree(string sWhere) |
| | |
| | | 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", "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 = "false!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Warehouse where HStopflag=0 Order by HItemID ", "h_v_IF_Warehouse"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Warehouse where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "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 = "false!"; |
| | | 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", "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 = "false!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择仓位基础资料 |
| | | |
| | | #region 条件查询仓位列表 |
| | | [Route("PublicPageMethod/WareLocationList")] |
| | | [HttpGet] |
| | | public object WareLocationList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | 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.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 根据树型id查找仓位列表 |
| | | [Route("Gy_MaintenanceMode/WareLocationCX")] |
| | | [HttpGet] |
| | | public object WareLocationCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_StockPlace WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_StockPlace AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_StockPlace"); |
| | | 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("Gy_MaintenanceMode/WareLocationLoadTree")] |
| | | [HttpGet] |
| | | public object WareLocationLoadTree(string sWhere) |
| | | { |
| | | 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"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Department where HStopflag=0 Order by HItemID ", "h_v_IF_Department"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Department where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "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 = "false!"; |
| | | 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", "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 = "false!"; |
| | | objJsonResult.Message = "当前组织数据未维护!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 选择订单等级基础资料 |
| | | |
| | | #region 条件查询订单等级 |
| | | [Route("PublicPageMethod/OrderLevList")] |
| | | [HttpGet] |
| | | public object OrderLevList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_OrderLev " + sWhere + " Order by HItemID ", "Gy_OrderLev"); |
| | | 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 根据树型id查找订单等级 |
| | | [Route("Gy_MaintenanceMode/OrderLevCX")] |
| | | [HttpGet] |
| | | public object OrderLevCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_OrderLev WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_OrderLev AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_OrderLev"); |
| | | 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("Gy_MaintenanceMode/OrderLevLoadTree")] |
| | | [HttpGet] |
| | | public object OrderLevLoadTree(string sWhere) |
| | | { |
| | | 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_OrderLev " + sWhere + "", "Gy_OrderLev"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 选择订单反馈状态基础资料 |
| | | |
| | | #region 条件查询订单反馈状态 |
| | | [Route("PublicPageMethod/OrderBackInfoList")] |
| | | [HttpGet] |
| | | public object OrderBackInfoList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_OrderBackInfo " + sWhere + " Order by HItemID ", "Gy_OrderBackInfo"); |
| | | 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 根据树型id查找订单反馈状态 |
| | | [Route("Gy_MaintenanceMode/OrderBackInfoCX")] |
| | | [HttpGet] |
| | | public object OrderBackInfoCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_OrderBackInfo WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_OrderBackInfo AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_OrderBackInfo"); |
| | | 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("Gy_MaintenanceMode/OrderBackInfoLoadTree")] |
| | | [HttpGet] |
| | | public object OrderBackInfoLoadTree(string sWhere) |
| | | { |
| | | 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_OrderBackInfo " + sWhere + "", "Gy_OrderBackInfo"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 选择成品模具基础资料 |
| | | |
| | | #region 条件查询成品模具列表 |
| | |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName,HModel from h_v_Gy_Mould Order by HNumber", "h_v_IF_Department"); |
| | | 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 |
| | | { |
| | |
| | | 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查找维修项目列表 |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 选择供应商基础资料 |
| | | #region 选择维修验收项目基础资料 |
| | | |
| | | #region 条件查询供应商列表 |
| | | [Route("PublicPageMethod/SupplierList")] |
| | | #region 条件查询维修验收项目列表 |
| | | [Route("PublicPageMethod/RepairCheckItemList")] |
| | | [HttpGet] |
| | | public object SupplierList(string sWhere) |
| | | public object RepairCheckItemList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Supplier where HStopflag=0 Order by HItemID", "Gy_Supplier"); |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_RepairCheck where HStopflag=0 Order by HItemID", "Gy_RepairCheck"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_Supplier where 1 = 1 "; |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_RepairCheck where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_Supplier"); |
| | | ds = oCN.RunProcReturn(sql, "Gy_RepairCheck"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | 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/RepairCheckItemCX")] |
| | | [HttpGet] |
| | | public object RepairCheckItemCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_RepairCheck WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_RepairCheck AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_RepairCheck"); |
| | | 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("Gy_MaintenanceMode/RepairCheckItemLoadTree")] |
| | | [HttpGet] |
| | | public object RepairCheckItemLoadTree(string sWhere) |
| | | { |
| | | 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_RepairCheck", "Gy_RepairCheck"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择供应商基础资料 |
| | | |
| | | #region 条件查询供应商列表 |
| | | [Route("PublicPageMethod/SupplierList")] |
| | | [HttpGet] |
| | | public object SupplierList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | 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"; |
| | | // 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) |
| | | { |
| | |
| | | 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", "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"; |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 选择故障类型基础资料 |
| | | |
| | | #region 条件查询故障类型列表 |
| | | [Route("PublicPageMethod/FaultTypeList")] |
| | | [HttpGet] |
| | | public object FaultTypeList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_ConkType where HStopflag=0 Order by HItemID", "Gy_ConkType"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_ConkType where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_ConkType"); |
| | | } |
| | | 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 根据树型id查找故障类型列表 |
| | | [Route("Gy_MaintenanceMode/FaultTypeCX")] |
| | | [HttpGet] |
| | | public object FaultTypeCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_ConkType WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_ConkType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_ConkType"); |
| | | 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("Gy_MaintenanceMode/FaultTypeLoadTree")] |
| | | [HttpGet] |
| | | public object FaultTypeLoadTree(string sWhere) |
| | | { |
| | | 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_ConkType", "Gy_ConkType"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择故障原因设置基础资料 |
| | | |
| | | #region 条件查询故障原因设置列表 |
| | | [Route("PublicPageMethod/FaultReasonList")] |
| | | [HttpGet] |
| | | public object FaultReasonList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_ConkReason where HStopflag=0 Order by HItemID", "Gy_ConkReason"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_ConkReason where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_ConkReason"); |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | | //故障原因页面优化后查询 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")] |
| | | [HttpGet] |
| | | public object FaultReasonCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_ConkReason WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_ConkReason AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_ConkReason"); |
| | | 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("Gy_MaintenanceMode/FaultReasonLoadTree")] |
| | | [HttpGet] |
| | | public object FaultReasonLoadTree(string sWhere) |
| | | { |
| | | 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_ConkReason", "Gy_ConkReason"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择设备基础资料 |
| | | |
| | | #region 条件查询设备列表 |
| | | [Route("PublicPageMethod/EqpList")] |
| | | [HttpGet] |
| | | public object EqpList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HInterID,HEquipFileNumber,HName from Gy_EquipFileBillMain Order by HInterID", "Gy_EquipFileBillMain"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HInterID,HEquipFileNumber,HName from Gy_EquipFileBillMain where 1 = 1 "; |
| | | 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"; |
| | | 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 根据树型id查找设备列表 |
| | | [Route("Gy_MaintenanceMode/EqpCX")] |
| | | [HttpGet] |
| | | public object EqpCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_EquipMent WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_EquipMent AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_EquipMent"); |
| | | 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("Gy_MaintenanceMode/EqpLoadTree")] |
| | | [HttpGet] |
| | | public object EqpLoadTree(string sWhere) |
| | | { |
| | | 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_EquipMent", "Gy_EquipMent"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择检验项目类别基础资料 |
| | | |
| | | #region 条件查询设备列表 |
| | | [Route("PublicPageMethod/CheckItemTypeList")] |
| | | [HttpGet] |
| | | public object CheckItemTypeList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_QCCheckClass where HStopflag=0 Order by HItemID", "Gy_QCCheckClass"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_QCCheckClass where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_QCCheckClass"); |
| | | } |
| | | 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 根据树型id查找设备列表 |
| | | [Route("Gy_MaintenanceMode/CheckItemTypeCX")] |
| | | [HttpGet] |
| | | public object CheckItemTypeCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_QCCheckClass WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_QCCheckClass AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_QCCheckClass"); |
| | | 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("Gy_MaintenanceMode/CheckItemTypeLoadTree")] |
| | | [HttpGet] |
| | | public object CheckItemTypeLoadTree(string sWhere) |
| | | { |
| | | 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_QCCheckClass", "Gy_QCCheckClass"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择班组基础资料 |
| | | |
| | | #region 条件查询班组列表 |
| | | [Route("PublicPageMethod/GroupList")] |
| | | [HttpGet] |
| | | public object GroupList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Group where HStopflag=0 Order by HItemID", "h_v_IF_Group"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Group where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_Group"); |
| | | } |
| | | 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 根据树型id查找班组列表 |
| | | [Route("Gy_MaintenanceMode/GroupCX")] |
| | | [HttpGet] |
| | | public object GroupCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Group WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Group AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Group"); |
| | | 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("Gy_MaintenanceMode/GroupLoadTree")] |
| | | [HttpGet] |
| | | public object GroupLoadTree(string sWhere) |
| | | { |
| | | 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_Group", "h_v_IF_Group"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择资源基础资料 |
| | | |
| | | #region 条件查询资源列表 |
| | | [Route("PublicPageMethod/SourceList")] |
| | | [HttpGet] |
| | | public object SourceList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Source where HStopflag=0 Order by HItemID", "Gy_Source"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_Source where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_Source"); |
| | | } |
| | | 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 根据树型id查找资源列表 |
| | | [Route("Gy_MaintenanceMode/SourceCX")] |
| | | [HttpGet] |
| | | public object SourceCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_Source WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_Source AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Source"); |
| | | 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("Gy_MaintenanceMode/SourceLoadTree")] |
| | | [HttpGet] |
| | | public object SourceLoadTree(string sWhere) |
| | | { |
| | | 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_Source", "Gy_Source"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择物料基础资料 |
| | | |
| | | #region 条件查询物料列表 |
| | | [Route("PublicPageMethod/PartList")] |
| | | [HttpGet] |
| | | public object PartList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | 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) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 根据树型id查找物料列表 |
| | | [Route("Gy_MaintenanceMode/PartCX")] |
| | | [HttpGet] |
| | | public object PartCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Material WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Material AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "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; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 树型列表物料列表数据 |
| | | [Route("Gy_MaintenanceMode/PartLoadTree")] |
| | | [HttpGet] |
| | | public object PartLoadTree(string sWhere) |
| | | { |
| | | 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"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择单位基础资料 |
| | | |
| | | #region 条件查询单位列表 |
| | | [Route("PublicPageMethod/UnitList")] |
| | | [HttpGet] |
| | | public object UnitList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from h_v_IF_Unit where HStopflag=0 Order by HItemID", "h_v_IF_Unit"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Unit "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_Unit"); |
| | | } |
| | | 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 根据树型id查找单位列表 |
| | | [Route("Gy_MaintenanceMode/UnitCX")] |
| | | [HttpGet] |
| | | public object UnitCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Unit WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Unit AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Unit"); |
| | | 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("Gy_MaintenanceMode/UnitLoadTree")] |
| | | [HttpGet] |
| | | public object UnitLoadTree(string sWhere) |
| | | { |
| | | 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_Unit", "h_v_IF_Unit"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择辅助属性基础资料 |
| | | |
| | | #region 条件查询辅助属性列表 |
| | | [Route("PublicPageMethod/PropertyList")] |
| | | [HttpGet] |
| | | public object PropertyList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Property where HStopflag=0 Order by HItemID", "Gy_Property"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_Property where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "Gy_Property"); |
| | | } |
| | | |
| | | 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/PropertyCX")] |
| | | [HttpGet] |
| | | public object PropertyCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_Property WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_Property AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "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; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 树型列表辅助属性列表数据 |
| | | [Route("Gy_MaintenanceMode/PropertyLoadTree")] |
| | | [HttpGet] |
| | | public object PropertyLoadTree(string sWhere) |
| | | { |
| | | 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_Property", "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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择保养项目基础资料 |
| | | |
| | | #region 条件查询保养项目列表 |
| | | [Route("PublicPageMethod/MaintainList")] |
| | | [HttpGet] |
| | | public object MaintainList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Maintain " + sWhere + " Order by HItemID ", "Gy_Maintain"); |
| | | 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 根据树型id查找保养项目列表 |
| | | [Route("Gy_MaintenanceMode/MaintainCX")] |
| | | [HttpGet] |
| | | public object MaintainCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_Maintain WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_Maintain AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Maintain"); |
| | | 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("Gy_MaintenanceMode/MaintainLoadTree")] |
| | | [HttpGet] |
| | | public object MaintainLoadTree(string sWhere) |
| | | { |
| | | 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_Maintain " + sWhere + "", "Gy_Maintain"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择检验项目基础资料 |
| | | |
| | | #region 条件查询检验项目列表 |
| | | [Route("PublicPageMethod/CheckItemList")] |
| | | [HttpGet] |
| | | public object CheckItemList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_QCCheckItem " + sWhere + " Order by HItemID ", "Gy_QCCheckItem"); |
| | | 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 根据树型id查找检验项目列表 |
| | | [Route("Gy_MaintenanceMode/CheckItemCX")] |
| | | [HttpGet] |
| | | public object CheckItemCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_QCCheckItem WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_QCCheckItem AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_QCCheckItem"); |
| | | 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("Gy_MaintenanceMode/CheckItemLoadTree")] |
| | | [HttpGet] |
| | | public object CheckItemLoadTree(string sWhere) |
| | | { |
| | | 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_QCCheckItem " + sWhere + "", "Gy_QCCheckItem"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择物料类型基础资料 |
| | | |
| | | #region 条件查询物料类型列表 |
| | | [Route("PublicPageMethod/MaterTypeList")] |
| | | [HttpGet] |
| | | public object MaterTypeList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_MaterType " + sWhere + " Order by HItemID ", "Gy_MaterType"); |
| | | 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 根据树型id查找物料类型列表 |
| | | [Route("Gy_MaintenanceMode/MaterTypeCX")] |
| | | [HttpGet] |
| | | public object MaterTypeCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_MaterType WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_MaterType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_QCCheckItem"); |
| | | 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("Gy_MaintenanceMode/MaterTypeLoadTree")] |
| | | [HttpGet] |
| | | public object MaterTypeLoadTree(string sWhere) |
| | | { |
| | | 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_MaterType " + sWhere + "", "Gy_MaterType"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择工艺路线基础资料 |
| | | |
| | | #region 条件查询工艺路线列表 |
| | | [Route("PublicPageMethod/RouteList")] |
| | | [HttpGet] |
| | | public object RouteList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select HItemID,'' HParentID,HNumber,HName from h_v_IF_MouldRouting " + sWhere + " Order by HItemID ", "h_v_IF_MouldRouting"); |
| | | 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 |
| | | |
| | | #endregion |
| | | |
| | | #region 选择BOM组基础资料 |
| | | |
| | | #region 条件查询BOM组列表 |
| | | [Route("PublicPageMethod/BomGroupList")] |
| | | [HttpGet] |
| | | public object BomGroupList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_ICBomGroup " + sWhere + " Order by HItemID ", "Gy_ICBomGroup"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无BOM数据!"; |
| | | 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 根据树型id查找BOM组列表 |
| | | [Route("Gy_MaintenanceMode/BomGroupCX")] |
| | | [HttpGet] |
| | | public object BomGroupCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_ICBomGroup WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_ICBomGroup AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_ICBomGroup"); |
| | | 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 树型列表BOM组列表数据 |
| | | [Route("Gy_MaintenanceMode/BomGroupLoadTree")] |
| | | [HttpGet] |
| | | public object BomGroupLoadTree(string sWhere) |
| | | { |
| | | 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_ICBomGroup " + sWhere + "", "Gy_ICBomGroup"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无BOM数据!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择仓位组基础资料 |
| | | |
| | | #region 条件查询仓位组列表 |
| | | [Route("PublicPageMethod/HSPGroupList")] |
| | | [HttpGet] |
| | | public object HSPGroupList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_StockPlaceGroup " + sWhere + " Order by HItemID ", "Gy_StockPlaceGroup"); |
| | | 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 根据树型id查找仓位组列表 |
| | | [Route("Gy_MaintenanceMode/HSPGroupCX")] |
| | | [HttpGet] |
| | | public object HSPGroupCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_StockPlaceGroup WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_StockPlaceGroup AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_StockPlaceGroup"); |
| | | 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("Gy_MaintenanceMode/HSPGroupLoadTree")] |
| | | [HttpGet] |
| | | public object HSPGroupLoadTree(string sWhere) |
| | | { |
| | | 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_StockPlaceGroup " + sWhere + "", "Gy_StockPlaceGroup"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择地区基础资料 |
| | | |
| | | #region 条件查询地区列表 |
| | | [Route("PublicPageMethod/AreaList")] |
| | | [HttpGet] |
| | | public object AreaList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_AreaSet " + sWhere + " Order by HItemID ", "Gy_AreaSet"); |
| | | 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 根据树型id查找地区列表 |
| | | [Route("Gy_MaintenanceMode/AreaCX")] |
| | | [HttpGet] |
| | | public object AreaCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_AreaSet WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_AreaSet AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_AreaSet"); |
| | | 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("Gy_MaintenanceMode/AreaLoadTree")] |
| | | [HttpGet] |
| | | public object AreaLoadTree(string sWhere) |
| | | { |
| | | 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_AreaSet " + sWhere + "", "Gy_AreaSet"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择货币基础资料 |
| | | |
| | | #region 条件查询货币列表 |
| | | [Route("PublicPageMethod/CurrencyList")] |
| | | [HttpGet] |
| | | public object CurrencyList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Currency " + sWhere + " Order by HItemID ", "Gy_Currency"); |
| | | 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 根据树型id查找货币列表 |
| | | [Route("Gy_MaintenanceMode/CurrencyCX")] |
| | | [HttpGet] |
| | | public object CurrencyCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_Currency WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_Currency AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Currency"); |
| | | 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("Gy_MaintenanceMode/CurrencyLoadTree")] |
| | | [HttpGet] |
| | | public object CurrencyLoadTree(string sWhere) |
| | | { |
| | | 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_Currency " + sWhere + "", "Gy_Currency"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择结算方式基础资料 |
| | | |
| | | #region 条件查询结算方式列表 |
| | | [Route("PublicPageMethod/SettleStyleList")] |
| | | [HttpGet] |
| | | public object SettleStyleList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_SettleStyle " + sWhere + " Order by HItemID ", "Gy_SettleStyle"); |
| | | 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 根据树型id查找结算方式列表 |
| | | [Route("Gy_MaintenanceMode/SettleStyleCX")] |
| | | [HttpGet] |
| | | public object SettleStyleCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_SettleStyle WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_SettleStyle AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_SettleStyle"); |
| | | 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("Gy_MaintenanceMode/SettleStyleLoadTree")] |
| | | [HttpGet] |
| | | public object SettleStyleLoadTree(string sWhere) |
| | | { |
| | | 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_SettleStyle " + sWhere + "", "Gy_SettleStyle"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择客户分类基础资料 |
| | | |
| | | #region 条件查询客户分类列表 |
| | | [Route("PublicPageMethod/CusTypeList")] |
| | | [HttpGet] |
| | | public object CusTypeList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_CusType " + sWhere + " Order by HItemID ", "Gy_CusType"); |
| | | 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 根据树型id查找客户分类列表 |
| | | [Route("Gy_MaintenanceMode/CusTypeCX")] |
| | | [HttpGet] |
| | | public object CusTypeCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_CusType WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_CusType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_CusType"); |
| | | 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("Gy_MaintenanceMode/CusTypeLoadTree")] |
| | | [HttpGet] |
| | | public object CusTypeLoadTree(string sWhere) |
| | | { |
| | | 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_CusType " + sWhere + "", "Gy_CusType"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择登录组织基础资料 |
| | | |
| | | #region 条件查询组织列表 |
| | | [Route("PublicPageMethod/OrganizationsList")] |
| | | [HttpGet] |
| | | public object OrganizationsList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Xt_ORGANIZATIONS " + sWhere + " Order by HItemID ", "Xt_ORGANIZATIONS"); |
| | | 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 根据树型id查找组织列表 |
| | | [Route("Gy_MaintenanceMode/OrganizationsCX")] |
| | | [HttpGet] |
| | | public object OrganizationsCX(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_CusType Xt_ORGANIZATIONS HitemID=" + HInterID + " UNION ALL select s.* from Xt_ORGANIZATIONS AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Xt_ORGANIZATIONS"); |
| | | 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("Gy_MaintenanceMode/OrganizationsLoadTree")] |
| | | [HttpGet] |
| | | public object OrganizationsLoadTree(string sWhere) |
| | | { |
| | | 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 Xt_ORGANIZATIONS " + sWhere + "", "Xt_ORGANIZATIONS"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择用户基础资料 |
| | | |
| | | #region 条件查询用户列表 |
| | | [Route("PublicPageMethod/PeopleList")] |
| | | [HttpGet] |
| | | public object PeopleList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("Select czybm HNumber,czymc HName from h_v_Gy_UserList " + sWhere + " 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 |
| | | |
| | | #endregion |
| | | |
| | | #region 用户关联权限 |
| | | |
| | | #region 条件查询权限列表 |
| | | [Route("PublicPageMethod/PowerList")] |
| | | [HttpGet] |
| | | public object PowerList(string czybm, string sGnbm,string HSouceBillType) |
| | | { |
| | | try |
| | | { |
| | | string sName = ""; |
| | | if (sGnbm != "" && sGnbm != null) |
| | | { |
| | | if (sGnbm == "权限管理-用户") |
| | | { |
| | | sName = ""; |
| | | } |
| | | else |
| | | { |
| | | 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"); |
| | | } |
| | | |
| | | 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,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"; |
| | | 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 树型列表功能列表数据 |
| | | [Route("Gy_MaintenanceMode/PowerLoadTree")] |
| | | [HttpGet] |
| | | public object PowerLoadTree() |
| | | { |
| | | 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='' 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) |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | | #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 |
| | | |
| | | } |
| | | } |