1
zrg
2024-08-26 88f49ce7ac39cdfafead5c4a321d9a657b2ec465
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -22,7 +22,7 @@
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        public string sWhere = "";
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
@@ -237,7 +237,7 @@
        #region 获取项目号
        [Route("Gy_Material/Get_HProject")]
        [HttpGet]
        public object Get_HProject(string HOrgID)
        public object Get_HProject()
        {
            try
            {
@@ -261,6 +261,59 @@
        }
        #endregion
        /// <summary>
        /// 获取项目列表
        /// </summary>
        /// <returns></returns>
        [Route("Gy_Material/GetProjectGroupList_Json")]
        [HttpGet]
        public object GetProjectGroupList_Json(string Unit)
            {
                if (Unit != "" && Unit != null)
                {
                    sWhere = sWhere + " and ( HBillNo like '%" + Unit + "%' or HProName like '%" + Unit + "%' ) ";
                }
                try
                {
                    SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                    if (sWhere == null || sWhere.Equals(""))
                    {
                        ds = oCN.RunProcReturn("Select HInterID,HBillNo 项目代码,HProName 项目组 from PM_ProjectBillMain where HCloseType = 0 Order by HInterID ", "PM_ProjectBillMain");
                    }
                    else
                    {
                        string sql1 = "Select HInterID,HBillNo 项目代码,HProName 项目组 from PM_ProjectBillMain where HCloseType = 0 ";
                        string sql = sql1 + sWhere;
                        ds = oCN.RunProcReturn(sql, "PM_ProjectBillMain");
                    }
                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;
            }
        }
        #region 获取事业部
        [Route("Gy_Material/Get_Gy_Division")]
        [HttpGet]