王 垚
2021-11-08 bfdba143a3228e23d40862b76a7b0ee2563f4d82
WebAPI/Controllers/PublicPageMethodController.cs
@@ -122,9 +122,9 @@
        #endregion
        #region 选择用户基础资料
        #region 选择职员基础资料
        #region 条件查询用户列表
        #region 条件查询职员列表
        [Route("PublicPageMethod/UserList")]
        [HttpGet]
        public object UserList(string sWhere)
@@ -161,7 +161,7 @@
        }
        #endregion
        #region  根据树型id查找用户列表
        #region  根据树型id查找职员列表
        [Route("Gy_MaintenanceMode/UserCX")]
        [HttpGet]
        public object UserCX(long HInterID)
@@ -198,7 +198,7 @@
        }
        #endregion
        #region 树型列表用户列表数据
        #region 树型列表职员列表数据
        [Route("Gy_MaintenanceMode/UserLoadTree")]
        [HttpGet]
        public object UserLoadTree(string sWhere)
@@ -542,6 +542,219 @@
        #endregion
        #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 选择成品模具基础资料
@@ -895,22 +1108,22 @@
            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
                {
                //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)
            {
@@ -1229,13 +1442,13 @@
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_EquipMent where HStopflag=0 Order by HItemID", "Gy_EquipMent");
                    ds = oCN.RunProcReturn("Select HInterID,HEquipFileNumber,HName from Gy_EquipFileBillMain Order by HInterID", "Gy_EquipFileBillMain");
                }
                else
                {
                    string sql1 = "Select HItemID,HParentID,HNumber,HName from Gy_EquipMent where 1 = 1 ";
                    string sql1 = "Select HInterID,HEquipFileNumber,HName from Gy_EquipFileBillMain where 1 = 1 ";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "Gy_EquipMent");
                    ds = oCN.RunProcReturn(sql, "HEquipFileNumber");
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
@@ -2992,6 +3205,151 @@
        #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
    }
}