wtt
6 天以前 9124a9b2e9f4a041da4509039c65a70cc81dd033
WebAPI/Controllers/WebAPIController.cs
@@ -7234,6 +7234,18 @@
                    }
                    else//编辑时判断
                    {
                        //已审核不允许修改
                        DataSet dss;
                        dss = oCN.RunProcReturn("select * from Gy_PostSkill where HItemID=" + oItem.HItemID, "Gy_Group");
                        //判断是否可编辑
                        if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据状态已经审核,不允许修改!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -7864,6 +7876,18 @@
                    }
                    else//编辑时判断
                    {
                        //已审核不允许修改
                        DataSet dss;
                        dss = oCN.RunProcReturn("select * from Gy_Post where HItemID=" + oItem.HItemID, "Gy_Post");
                        //判断是否可编辑
                        if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据状态已经审核,不允许修改!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -14613,7 +14637,7 @@
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_PreventErrMould where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PreventErrMould");
                    //ds = oCN.RunProcReturn("select * from  Gy_PreventErrMould where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PreventErrMould");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
@@ -14622,21 +14646,32 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("Select HItemID from Gy_PreventErrMould  Where HItemID<>" + oItem.HItemID + " and HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID=" + oItem.HUSEORGID, "Gy_PreventErrMould");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码重复!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        //if (ds == null || ds.Tables[0].Rows.Count == 0)
                        //{
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //}
                        //else
                        //{
                        //    objJsonResult.code = "0";
                        //    objJsonResult.count = 0;
                        //    objJsonResult.Message = "保存失败!代码重复!";
                        //    objJsonResult.data = 1;
                        //    return objJsonResult;
                        //}
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -14662,6 +14697,18 @@
                    }
                    else//编辑时判断
                    {
                        //已审核不允许修改
                        DataSet dss;
                        dss = oCN.RunProcReturn("select * from Gy_PreventErrMould where HItemID=" + oItem.HItemID, "Gy_PreventErrMould");
                        //判断是否可编辑
                        if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据状态已经审核,不允许修改!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -15251,7 +15298,7 @@
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_CheckNoteItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CheckNoteItem");
                    //ds = oCN.RunProcReturn("select * from  Gy_CheckNoteItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CheckNoteItem");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
@@ -15260,21 +15307,21 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("Select HItemID from Gy_CheckNoteItem  Where HItemID<>" + oItem.HItemID + " and HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID=" + oItem.HUSEORGID, "Gy_CheckNoteItem");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码重复!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -15300,6 +15347,18 @@
                    }
                    else//编辑时判断
                    {
                        //已审核不允许修改
                        DataSet dss;
                        dss = oCN.RunProcReturn("select * from Gy_CheckNoteItem where HItemID=" + oItem.HItemID, "Gy_CheckNoteItem");
                        //判断是否可编辑
                        if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据状态已经审核,不允许修改!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -19291,23 +19350,19 @@
        /// <returns></returns>
        [Route("Web/GetSc_ProcessExchangeBillListView")]
        [HttpGet]
        public object GetSc_ProcessExchangeBillListView(string ICMOBill, int OrganizationID)
        {
            if (ICMOBill != "" & ICMOBill != null)
            {
                sWhere = " where 1=1 and 单据号 like '%" + ICMOBill + "%' ";
            }
        public object GetSc_ProcessExchangeBillListView(string sWhere,int OrganizationID)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select top 500 * from h_v_Sc_ProcessExchangeBillList where 1=1  order by 单据号 desc,hsubid", "h_v_Sc_ProcessExchangeBillList");
                }
                    ds = oCN.RunProcReturn("select top 300 * from h_v_Sc_ProcessExchangeBillList_PDA where 1=1  order by 单据号 desc,hsubid", "h_v_Sc_ProcessExchangeBillList_PDA");
                }
                else
                {
                    string sql = "select * from h_v_Sc_ProcessExchangeBillList " + sWhere + " order by 单据号 desc,hsubid ";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBillList");
                    string sql = "select * from h_v_Sc_ProcessExchangeBillList_PDA  where 1=1 " + sWhere + " order by 单据号 desc,hsubid ";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBillList_PDA");
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
@@ -20971,6 +21026,33 @@
                return objJsonResult;
            }
        }
        //获取所有模块页面
        [Route("Web/ModePageList")]
        [HttpGet]
        public object ModePageList()
        {
            try
            {
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                ds = oCn.RunProcReturn("Select * from Gy_Menu_1 where isnull(Hurl,'')  like'%html%'  Order by HItemID ", "Gy_Menu");     //获取Gy_Menu_1中的所有菜单信息,用于为menuInitList列表充
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "查询成功!";
                objJsonResult.data = ds;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询失败!";
                objJsonResult.data = e.ToString();
                return objJsonResult;
            }
        }
        #endregion
        #region 保存自定义数据
@@ -21070,7 +21152,7 @@
        //快捷方式自定义菜单:获取树组件数据
        [Route("Web/Xt_UserFastMenu_Display")]
        [HttpGet]
        public object Xt_UserFastMenu_Display(string HMakeName, string HType)
        public object Xt_UserFastMenu_Display(string HMakeName, string HType,string HModelAtributos)
        {
            try
            {
@@ -21095,7 +21177,7 @@
                    menuInit.HSelected = false;
                    //判断用户是否选中显示该菜单
                    String sql = "Select * from Xt_UserFastMenu where HSubFuncID = '" + ds.Tables[0].Rows[i]["HItemID"] + "' and HUserID='" + HMakeName + "'";
                    String sql = "Select * from Xt_UserFastMenu where HSubFuncID = '" + ds.Tables[0].Rows[i]["HItemID"] + "' and HUserID='" + HMakeName + "' and HModelAtributos='" + HModelAtributos + "'";
                    ds1 = oCn.RunProcReturn(sql, "Xt_UserFastMenu");
                    if (ds1.Tables[0].Rows.Count > 0)                           //对于Gy_Menu_1表中的菜单节点,通过检索在Gy_MenuDefineSet表中对应用户是否存在该节点的信息,判断该用户是否选中该节点需要加载显示在侧菜单栏
                    {
@@ -21163,6 +21245,7 @@
                string HMakeName = sArray[1].ToString();
                string saveData = sArray[0].ToString();
                string HTypes = sArray[2].ToString();
                string HModelAtributos = sArray[3].ToString();
                List<SaveDefineMenu> saveDataList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SaveDefineMenu>>(saveData);
                //声明数据库操作工具
@@ -21172,7 +21255,7 @@
                oCN.BeginTran();
                //删除当前用户的自定义数据
                string sql = "delete from Xt_UserFastMenu where HUserID = '" + HMakeName + "' and HType = '" + HTypes + "'";
                string sql = "delete from Xt_UserFastMenu where HUserID = '" + HMakeName + "' and HType = '" + HTypes + "' and HModelAtributos = '" + HModelAtributos + "'";
                oCN.RunProc(sql);
                //插入当前用户最新的自定义数据
@@ -21191,7 +21274,7 @@
                            string HCaption = ds.Tables[0].Rows[0]["HName"].ToString();
                            string HType = ds.Tables[0].Rows[0]["HType"].ToString();
                            sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "')";
                            sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType,HModelAtributos) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "','"+ HModelAtributos + "')";
                            oCN.RunProc(sql);
                        }
                    }
@@ -21221,17 +21304,17 @@
        //快捷方式自定义菜单:获取树组件数据
        [Route("Web/Xt_UserFastMenu_Init")]
        [HttpGet]
        public object Xt_UserFastMenu_Init(string HMakeName, string HType)
        public object Xt_UserFastMenu_Init(string HMakeName, string HType,string HModelAtributos)
        {
            try
            {
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                string sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID  where a.HUserID = '" + HMakeName + "' and b.HType = '" + HType + "' Order by a.HItemID";
                string sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID  where a.HUserID = '" + HMakeName + "' and b.HType = '" + HType + "'  and a.HModelAtributos = '" + HModelAtributos + "' Order by a.HItemID";
                ds = oCn.RunProcReturn(sql, "Xt_UserFastMenu");     //获取Xt_UserFastMenu中该用户设置的自定义菜单信息,用于在前端加载
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID  where a.HUserID = 'admin' and b.HType = '" + HType + "' Order by a.HItemID";
                    sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID  where a.HUserID = 'admin' and b.HType = '" + HType + "' and a.HModelAtributos = '" + HModelAtributos + "' Order by a.HItemID";
                    ds = oCn.RunProcReturn(sql, "Xt_UserFastMenu");     //获取Xt_UserFastMenu中该用户设置的自定义菜单信息,用于在前端加载
                }