王 垚
2022-07-12 ddabe21abf229d23ccb248276e818c5e1101033d
WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs
@@ -30,27 +30,36 @@
        /// </summary>
        [Route("Gy_ModelType/list")]
        [HttpGet]
        public object list(string sWhere)
        public object list(string sWhere, string ModRightNameSelect, string user)
        {
            try
            {
                ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_MouldType where 1=1 " + sWhere, "Gy_MouldType");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                if (!DBUtility.ClsPub.Security_Log(ModRightNameSelect, 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无模治具分类数据!";
                    objJsonResult.Message = "没有查看权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "查找成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_MouldType where 1=1 " + sWhere+ " order by HNumber", "Gy_MouldType");
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception e)
            {
@@ -120,14 +129,14 @@
            try
            {
                //if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "没有删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, false, User))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有删除权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oDeptHlp.GetInfoByID(HItemID))
                {
                    if (oDept.HavChildCodes(HItemID))
@@ -201,10 +210,15 @@
            {
                var _value = oMain["oMain"].ToString();
                string msg1 = _value.ToString();
                //反序列化
                msg1 = "[" + msg1.ToString() + "]";
                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                string msg2 = sArray[0].ToString();
                string msg3 = sArray[1].ToString();//当前人
                string msg4 = sArray[2].ToString();//模块权限
                List<Model.ClsGy_MouldType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MouldType_Model>>(msg1);
                //反序列化
                msg2 = "[" + msg2.ToString() + "]";
                List<Model.ClsGy_MouldType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MouldType_Model>>(msg2);
                string HNumber = list[0].HNumber;
                string HName = list[0].HName;
@@ -216,6 +230,16 @@
                bool HStopflag = list[0].HStopflag;
                string HUseFlag = list[0].HUseFlag;
                bool HEndFlag = list[0].HEndFlag;
                //判断权限
                if (!DBUtility.ClsPub.Security_Log(msg4, 1, false, msg3))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (!DBUtility.ClsPub.AllowNumber(HNumber))
                {
@@ -275,8 +299,8 @@
                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                string msg2 = sArray[0].ToString();
                string msg3 = sArray[1].ToString();
                string msg4 = sArray[2].ToString();
                string msg5 = sArray[3].ToString();
                string msg4 = sArray[2].ToString();//当前人
                string msg5 = sArray[3].ToString();//权限模块
                //反序列化
                msg2 = "[" + msg2.ToString() + "]";
@@ -293,14 +317,14 @@
                string HUseFlag = list[0].HUseFlag;
                //判断权限
                //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "没有找到该功能模块!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.Security_Log(msg5, 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有保存权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (!DBUtility.ClsPub.AllowNumber(HNumber))
@@ -415,5 +439,7 @@
            }
        }
        #endregion
    }
}