using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Net;
|
using System.Net.Http;
|
using System.Web.Http;
|
using WebAPI.Models;
|
|
namespace WebAPI.Controllers
|
{
|
public class PublicPageMethodController : ApiController
|
{
|
public DBUtility.ClsPub.Enum_BillStatus BillStatus;
|
|
private json objJsonResult = new json();
|
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
|
DataSet ds;
|
|
#region 选择往来单位基础资料
|
|
#region 条件查询往来单位列表
|
[Route("PublicPageMethod/CustomerList")]
|
[HttpGet]
|
public object CustomerList(string sWhere)
|
{
|
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");
|
}
|
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/CustomerCX")]
|
[HttpGet]
|
public object CustomerCX(long HInterID)
|
{
|
try
|
{
|
|
ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Customer WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Customer AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Customer");
|
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/CustomerLoadTree")]
|
[HttpGet]
|
public object CustomerLoadTree(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_Customer", "h_v_IF_Customer");
|
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/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");
|
}
|
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/UserCX")]
|
[HttpGet]
|
public object UserCX(long HInterID)
|
{
|
try
|
{
|
|
ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Emp WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Emp AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Emp");
|
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/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");
|
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/WareHouseList")]
|
[HttpGet]
|
public object WareHouseList(string sWhere)
|
{
|
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");
|
}
|
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/WareHouseCX")]
|
[HttpGet]
|
public object WareHouseCX(long HInterID)
|
{
|
try
|
{
|
|
ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Warehouse WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Warehouse AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Warehouse");
|
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/WareHouseLoadTree")]
|
[HttpGet]
|
public object WareHouseLoadTree(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_Warehouse", "h_v_IF_Warehouse");
|
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/WareLocationList")]
|
[HttpGet]
|
public object WareLocationList(string sWhere)
|
{
|
try
|
{
|
if (sWhere == null || sWhere.Equals(""))
|
{
|
ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_StockPlace where HStopflag=0 Order by HItemID ", "Gy_StockPlace");
|
}
|
else
|
{
|
string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_StockPlace where 1 = 1 ";
|
string sql = sql1 + sWhere;
|
ds = oCN.RunProcReturn(sql, "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 根据树型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", "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;
|
}
|
}
|
#endregion
|
|
#endregion
|
|
#region 选择部门基础资料
|
|
#region 条件查询部门列表
|
[Route("PublicPageMethod/DeptList")]
|
[HttpGet]
|
public object DeptList(string sWhere)
|
{
|
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");
|
}
|
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/DeptCX")]
|
[HttpGet]
|
public object DeptCX(long HInterID)
|
{
|
try
|
{
|
|
ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_IF_Department WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_IF_Department AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_IF_Department");
|
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/DeptLoadTree")]
|
[HttpGet]
|
public object DeptLoadTree(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_Department", "h_v_IF_Department");
|
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/MouldList")]
|
[HttpGet]
|
public object MouldList(string sWhere)
|
{
|
try
|
{
|
if (sWhere == null || sWhere.Equals(""))
|
{
|
ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName,HModel from h_v_Gy_Mould Order by HNumber", "h_v_Gy_Mould");
|
}
|
else
|
{
|
string sql1 = "Select HItemID,HParentID,HNumber,HName,HModel from h_v_Gy_Mould where 1 = 1 ";
|
string sql = sql1 + sWhere;
|
ds = oCN.RunProcReturn(sql, "h_v_Gy_Mould");
|
}
|
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/MouldCX")]
|
[HttpGet]
|
public object MouldCX(long HInterID)
|
{
|
try
|
{
|
|
ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_Gy_Mould WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_Gy_Mould AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "h_v_Gy_Mould");
|
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/MouldLoadTree")]
|
[HttpGet]
|
public object MouldLoadTree(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 from h_v_Gy_Mould", "h_v_Gy_Mould");
|
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/RepairItemList")]
|
[HttpGet]
|
public object RepairItemList(string sWhere)
|
{
|
try
|
{
|
if (sWhere == null || sWhere.Equals(""))
|
{
|
ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Repair where HStopflag=0 Order by HItemID", "Gy_Repair");
|
}
|
else
|
{
|
string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_Repair where 1 = 1 ";
|
string sql = sql1 + sWhere;
|
ds = oCN.RunProcReturn(sql, "Gy_Repair");
|
}
|
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/RepairItemCX")]
|
[HttpGet]
|
public object RepairItemCX(long HInterID)
|
{
|
try
|
{
|
|
ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_Repair WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_Repair AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Repair");
|
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/RepairItemLoadTree")]
|
[HttpGet]
|
public object RepairItemLoadTree(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_Repair", "Gy_Repair");
|
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/RepairCheckItemList")]
|
[HttpGet]
|
public object RepairCheckItemList(string sWhere)
|
{
|
try
|
{
|
if (sWhere == null || sWhere.Equals(""))
|
{
|
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_RepairCheck where 1 = 1 ";
|
string sql = sql1 + sWhere;
|
ds = oCN.RunProcReturn(sql, "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 根据树型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
|
{
|
if (sWhere == null || sWhere.Equals(""))
|
{
|
ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Supplier where HStopflag=0 Order by HItemID", "Gy_Supplier");
|
}
|
else
|
{
|
string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_Supplier where 1 = 1 ";
|
string sql = sql1 + sWhere;
|
ds = oCN.RunProcReturn(sql, "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)
|
{
|
objJsonResult.code = "0";
|
objJsonResult.count = 0;
|
objJsonResult.Message = "Exception!" + e.ToString();
|
objJsonResult.data = null;
|
return objJsonResult;
|
}
|
}
|
#endregion
|
|
#region 根据树型id查找供应商列表
|
[Route("Gy_MaintenanceMode/SupplierCX")]
|
[HttpGet]
|
public object SupplierCX(long HInterID)
|
{
|
try
|
{
|
|
ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.Gy_Supplier WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.Gy_Supplier AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "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)
|
{
|
objJsonResult.code = "0";
|
objJsonResult.count = 0;
|
objJsonResult.Message = "Exception!" + e.ToString();
|
objJsonResult.data = null;
|
return objJsonResult;
|
}
|
}
|
#endregion
|
|
#region 树型列表供应商列表数据
|
[Route("Gy_MaintenanceMode/SupplierLoadTree")]
|
[HttpGet]
|
public object SupplierLoadTree(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_Supplier", "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;
|
}
|
}
|
#endregion
|
|
#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;
|
}
|
}
|
#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 HItemID,HParentID,HNumber,HName from Gy_EquipMent where HStopflag=0 Order by HItemID", "Gy_EquipMent");
|
}
|
else
|
{
|
string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_EquipMent where 1 = 1 ";
|
string sql = sql1 + sWhere;
|
ds = oCN.RunProcReturn(sql, "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 根据树型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
|
{
|
if (sWhere == null || sWhere.Equals(""))
|
{
|
ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName,HModel from h_v_IF_Material where HStopflag=0 Order by HItemID", "h_v_IF_Material");
|
}
|
else
|
{
|
string sql1 = "Select HItemID,HParentID,HNumber,HName,HModel from h_v_IF_Material where 1 = 1 ";
|
string sql = sql1 + sWhere;
|
ds = oCN.RunProcReturn(sql, "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 根据树型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", "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 where 1 = 1 ";
|
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");
|
}
|
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/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
|
|
}
|
}
|