Example #1
0
        public void GETJFBXLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            string userName    = UserInfo.User.UserName;
            string strUserName = context.Request["username"] ?? "";//经费报销统计中的查看列表需要的参数

            if (!string.IsNullOrEmpty(strUserName))
            {
                userName = strUserName;
            }
            string strWhere = " ComId =" + UserInfo.User.ComId.Value;

            DataTable dtList    = new DataTable();
            int       page      = 0;
            int       pagecount = 8;

            int.TryParse(context.Request["p"] ?? "1", out page);              //页码
            int.TryParse(context.Request["pagecount"] ?? "8", out pagecount); //页数
            int DataID = -1;

            int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id
            if (DataID != -1)
            {
                string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("JFBX", DataID, UserInfo);
                if (strIsHasDataQX == "Y")
                {
                    strWhere += string.Format(" And ID = '{0}'", DataID);
                }
            }
            switch (P1)
            {
            case "0":     //手机单条数据
            {
                //设置usercenter已读
                new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "JFBX");
            }
            break;

            case "1":     //创建的
            {
                strWhere += " And CRUser ='******'";
            }
            break;

            case "2":     //待审核
            {
                var intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                if (intProD.Count > 0)
                {
                    strWhere += " And intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                }
                else
                {
                    strWhere += " And 1=0";
                }
            }
            break;

            case "3":      //已审核
            {
                var intProD = new Yan_WF_PIB().GetYSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                if (intProD.Count > 0)
                {
                    strWhere += " And intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                }
                else
                {
                    strWhere += " And 1=0";
                }
            }
            break;

            case "4":

                //获取当前登录人负责的下属人员
                string Users = new JH_Auth_UserB().GetUserBranchUsers(UserInfo.User.ComId.Value, UserInfo.User.UserName).Select(d => d.UserName).ToList().ListTOString(',');
                strWhere += string.Format("and   CRUser in ('{0}')", Users.ToFormatLike());
                break;
            }
            //根据创建时间查询
            string time = context.Request["time"] ?? "";

            if (time != "")
            {
                if (time == "1")   //近一周
                {
                    strWhere += string.Format(" And datediff(day,BXDate,getdate())<7");
                }
                else if (time == "2")
                {  //近一月
                    strWhere += string.Format(" And datediff(day,BXDate,getdate())<30");
                }
                else if (time == "3")  //自定义时间
                {
                    string strTime = context.Request["starTime"] ?? "";
                    string endTime = context.Request["endTime"] ?? "";
                    if (strTime != "")
                    {
                        strWhere += string.Format(" And BXDate >='{0}'", strTime);
                    }
                    if (endTime != "")
                    {
                        strWhere += string.Format(" And BXDate <='{0}'", endTime);
                    }
                }
            }
            string strContent = context.Request["Content"] ?? "";

            strContent = strContent.TrimEnd();
            if (strContent != "")
            {
                strWhere += string.Format(" And (BranchName like '%{0}%' or ShenQingRen like '%{0}%' or FormCode like '%{0}%' )", strContent);
            }
            page = page == 0 ? 1 : page;
            int recordCount = 0;

            dtList = new SZHL_JFBXB().GetDataPager(" SZHL_JFBX ", "*,dbo.fn_PDStatus(intProcessStanceid) AS StateName ", pagecount, page, "CRDate desc", strWhere, ref recordCount);

            msg.Result  = dtList;
            msg.Result1 = recordCount;
        }
Example #2
0
        /// <summary>
        /// 获取日志列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1">日志类型</param>
        /// <param name="P2">查询条件</param>
        /// <param name="strUserName"></param>
        public void GETGZBGLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int DataID = -1;

            int.TryParse(context.Request["ID"] ?? "-1", out DataID);//微信获取单个数据的ID


            int page      = 0;
            int pagecount = 8;

            int.TryParse(context.Request["p"] ?? "1", out page);              //页码
            int.TryParse(context.Request["pagecount"] ?? "8", out pagecount); //页数
            page = page == 0 ? 1 : page;
            int    recordCount = 0;
            string strWhere    = string.Format(" bg.ComId={0} ", UserInfo.User.ComId);
            string type        = context.Request["type"] ?? "1";

            if (type == "2")//下属报告
            {
                //获取当前登录人负责的下属人员
                string Users = new JH_Auth_UserB().GetUserBranchUsers(UserInfo.User.ComId.Value, UserInfo.User.UserName).Select(d => d.UserName).ToList().ListTOString(',');
                strWhere += string.Format("and   bg.CRUser in ('{0}')", Users.ToFormatLike());
            }
            else if (type == "1") //当前登录人报告
            {
                strWhere += string.Format("and   bg.CRUser='******'", UserInfo.User.UserName);
            }
            else if (type == "3")//获取抄送人报告
            {
                strWhere += string.Format("and    ','+bg.ChaoSongUser+',' like '%{0}%'", UserInfo.User.UserName);
            }

            if (P1 != "")//分类
            {
                strWhere += string.Format("And  bg.LeiBie={0}", P1);
            }
            if (P2 != "")//内容查询
            {
                strWhere += string.Format(" And (bg.RBContent like '%{0}%' OR bg.CRUserName like '%{0}%' OR bg.BranchName like '%{0}%' )", P2);
            }
            //根据创建时间查询
            string time = context.Request["time"] ?? "";

            if (time != "")
            {
                if (time == "1")   //近一周
                {
                    strWhere += string.Format(" And datediff(day,bg.RBDate,getdate())<7");
                }
                else if (time == "2")
                {  //近一月
                    strWhere += string.Format(" And datediff(day,bg.RBDate,getdate())<30");
                }
                else if (time == "3")  //自定义时间
                {
                    string strTime = context.Request["starTime"] ?? "";
                    string endTime = context.Request["endTime"] ?? "";
                    if (strTime != "")
                    {
                        strWhere += string.Format(" And convert(varchar(10),bg.RBDate,120) >='{0}'", strTime);
                    }
                    if (endTime != "")
                    {
                        strWhere += string.Format(" And convert(varchar(10),bg.RBDate,120) <='{0}'", endTime);
                    }
                }
            }
            if (DataID != -1)
            {
                string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("GZBG", DataID, UserInfo);
                if (strIsHasDataQX == "Y")
                {
                    strWhere += string.Format(" And bg.ID = '{0}'", DataID);
                }
                //更新消息为已读状态
                new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "GZBG");
            }
            DataTable dt      = new SZHL_GZBGB().GetDataPager(" SZHL_GZBG  bg inner join JH_Auth_ZiDian zd on LeiBie= zd.ID and Class=6  ", "bg.BranchName,bg.CRUserName,CONVERT(varchar(100), bg.RBDate, 23) as RBDate,zd.TypeName,bg.CRUser,bg.RBContent,bg.RBJSR,bg.RBWCQK,bg.LeiBie,bg.CRDate,bg.ID,bg.Files ", pagecount, page, "bg.CRDate desc", strWhere, ref recordCount);
            string    Ids     = "";
            string    fileIDs = "";

            foreach (DataRow row in dt.Rows)
            {
                Ids += row["ID"].ToString() + ",";
                if (!string.IsNullOrEmpty(row["Files"].ToString()))
                {
                    fileIDs += row["Files"].ToString() + ",";
                }
            }
            Ids     = Ids.TrimEnd(',');
            fileIDs = fileIDs.TrimEnd(',');

            dt.Columns.Add("PLList", Type.GetType("System.Object"));
            dt.Columns.Add("FileList", Type.GetType("System.Object"));
            if (Ids != "")
            {
                List <FT_File> FileList = new List <FT_File>();
                DataTable      dtPL     = new JH_Auth_TLB().GetDTByCommand(string.Format("SELECT tl.* FROM JH_Auth_TL tl WHERE tl.MSGType='GZBG' AND  tl.MSGTLYID in ({0})", Ids));
                dtPL.Columns.Add("FileList", Type.GetType("System.Object"));
                foreach (DataRow dr in dtPL.Rows)
                {
                    if (dr["MSGisHasFiles"] != null && dr["MSGisHasFiles"].ToString() != "")
                    {
                        int[] fileIds = dr["MSGisHasFiles"].ToString().SplitTOInt(',');
                        dr["FileList"] = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID));
                    }
                }

                if (!string.IsNullOrEmpty(fileIDs))
                {
                    int[] fileId = fileIDs.SplitTOInt(',');
                    FileList = new FT_FileB().GetEntities(d => fileId.Contains(d.ID)).ToList();
                }
                foreach (DataRow row in dt.Rows)
                {
                    row["PLList"] = dtPL.FilterTable("MSGTLYID='" + row["ID"] + "'");
                    if (FileList.Count > 0)
                    {
                        string[] fileIds = row["Files"].ToString().Split(',');
                        row["FileList"] = FileList.Where(d => fileIds.Contains(d.ID.ToString()));
                    }
                }
            }
            msg.Result  = dt;
            msg.Result1 = recordCount;
        }
Example #3
0
        /// <summary>
        /// 外勤签到列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void GETWQQDLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            string userName = UserInfo.User.UserName;
            string strWhere = " 1=1 and ComId=" + UserInfo.User.ComId;

            string strContent = context.Request["Content"] ?? "";

            strContent = strContent.TrimEnd();
            if (strContent != "")
            {
                strWhere += string.Format(" And ( QDContent like '%{0}%' or CRUserName like '%{0}%' or BranchName like '%{0}%')", strContent);
            }


            //根据创建时间查询
            string time = context.Request["time"] ?? "";

            if (time != "")
            {
                if (time == "1")   //近一周
                {
                    strWhere += string.Format(" And datediff(day,CRDate,getdate())<7");
                }
                else if (time == "2")
                {  //近一月
                    strWhere += string.Format(" And datediff(day,CRDate,getdate())<30");
                }
                else if (time == "3")  //自定义时间
                {
                    string strTime = context.Request["starTime"] ?? "";
                    string endTime = context.Request["endTime"] ?? "";
                    if (strTime != "")
                    {
                        strWhere += string.Format(" And convert(varchar(10),CRDate,120) >='{0}'", strTime);
                    }
                    if (endTime != "")
                    {
                        strWhere += string.Format(" And convert(varchar(10),CRDate,120) <='{0}'", endTime);
                    }
                }
            }


            int DataID = -1;

            int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id
            if (DataID != -1)
            {
                string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("WQQD", DataID, UserInfo);
                if (strIsHasDataQX == "Y")
                {
                    strWhere += string.Format(" And ID = '{0}'", DataID);
                }
            }

            if (P1 != "")
            {
                int page      = 0;
                int pagecount = 8;
                int.TryParse(context.Request["p"] ?? "1", out page);
                int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数
                page = page == 0 ? 1 : page;
                int       total = 0;
                DataTable dt    = new DataTable();
                switch (P1)
                {
                case "0":     //手机单条数据
                {
                    //设置usercenter已读
                    new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "WQQD");
                }
                break;

                case "1":     //创建的
                {
                    strWhere += " And CRUser ='******'";
                }
                break;

                case "2":     //汇报我的
                {
                    strWhere += string.Format(" And ','+HBUser+','  like '%,{0},%'", userName);
                }
                break;

                case "3":    //下属签到
                {
                    //获取当前登录人负责的下属人员
                    string Users = new JH_Auth_UserB().GetUserBranchUsers(UserInfo.User.ComId.Value, UserInfo.User.UserName).Select(d => d.UserName).ToList().ListTOString(',');
                    strWhere += string.Format("and   CRUser in ('{0}')", Users.ToFormatLike());
                }
                break;
                }
                dt = new SZHL_WQQDB().GetDataPager("SZHL_WQQD", "*", pagecount, page, " CRDate desc", strWhere, ref total);

                if (dt.Rows.Count > 0)
                {
                    dt.Columns.Add("FileList", Type.GetType("System.Object"));
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (dr["Files"] != null && dr["Files"].ToString() != "")
                        {
                            dr["FileList"] = new FT_FileB().GetEntities(" ID in (" + dr["Files"].ToString() + ")");
                        }
                    }
                }
                msg.Result  = dt;
                msg.Result1 = total;
            }
        }
Example #4
0
        public void GETKQJLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int page      = 0;
            int pagecount = 8;

            int.TryParse(context.Request["p"] ?? "1", out page);              //页码
            int.TryParse(context.Request["pagecount"] ?? "8", out pagecount); //页数
            page = page == 0 ? 1 : page;
            int    recordCount = 0;
            string strWhere    = string.Format(" ComId={0}", UserInfo.User.ComId);

            if (P2 != "")//内容查询
            {
                strWhere += string.Format(" And (KQUserName like '%{0}%' OR KQBranch like '%{0}%' )", P2);
            }
            //根据创建时间查询
            string time = context.Request["time"] ?? "";

            if (time != "")
            {
                if (time == "1")   //近一周
                {
                    strWhere += string.Format(" And datediff(day,KQDate,getdate())<7");
                }
                else if (time == "2")
                {  //近一月
                    strWhere += string.Format(" And datediff(day,KQDate,getdate())<30");
                }
                else if (time == "3")  //自定义时间
                {
                    string strTime = context.Request["starTime"] ?? "";
                    string endTime = context.Request["endTime"] ?? "";
                    if (strTime != "")
                    {
                        strWhere += string.Format(" And KQDate >='{0}'", strTime + "-01");
                    }
                    if (endTime != "")
                    {
                        DateTime endDate = DateTime.Parse(endTime + "-01");
                        strWhere += string.Format(" And KQDate <='{0}'", endDate.AddMonths(1));
                    }
                }
            }


            if (P1 != "")
            {
                switch (P1)
                {
                case "1":     //创建的
                {
                    strWhere += " And KQUser ='******'";
                }
                break;

                case "2":     //下属签到
                {
                    //获取当前登录人负责的下属人员
                    string Users = new JH_Auth_UserB().GetUserBranchUsers(UserInfo.User.ComId.Value, UserInfo.User.UserName).Select(d => d.UserName).ToList().ListTOString(',');
                    strWhere += string.Format(" and KQUser in ('{0}') ", Users.ToFormatLike());
                }
                break;
                }
            }

            string    strsql = string.Format("SELECT   isnull(sum(case when Status=1 then 1 else 0 end),0) CDCount, isnull(sum(case when Status=2 then 1 else 0 end),0) ZTCount FROM SZHL_KQJL where    DATEPART(MONTH,KQDate)= DATEPART(MONTH,getdate()) and ComId={0} and KQUser='******'", UserInfo.User.ComId, UserInfo.User.UserName);
            DataTable dtTJ   = new SZHL_KQJLB().GetDTByCommand(strsql);

            dtTJ.Columns.Add("QJCount");
            var    intProD = new Yan_WF_PIB().GetYSHUserPI(UserInfo.User.UserName, UserInfo.User.ComId.Value, "CCXJ").Select(d => d.ID.ToString()).ToList();
            string strSql1 = string.Format("SELECT  isnull(SUM(Daycount),0) from SZHL_CCXJ where intProcessStanceid in ({0})  and  DATEPART(MONTH,CRDate)= DATEPART(MONTH,getdate()) and  CRUser='******'", intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(','), UserInfo.User.UserName);
            object obj     = new SZHL_KQJLB().ExsSclarSql(strSql1);

            dtTJ.Rows[0]["QJCount"] = obj.ToString();
            DataTable dt = new SZHL_KQBCB().GetDataPager(" SZHL_KQJL", "* ", pagecount, page, "KQDate desc", strWhere + "  and Type=0", ref recordCount);

            dt.Columns.Add("QTDate");
            dt.Columns.Add("QTStatus");
            dt.Columns.Add("QTPosition");
            foreach (DataRow row in dt.Rows)
            {
                string strSql2 = string.Format("SELECT top 1 * from SZHL_KQJL where ComId={0} and KQUser='******' AND DATEDIFF(DAY,KQDate,'{2}')=0 and Type=1  ORDER by KQDate DESC", UserInfo.User.ComId, row["KQUser"], row["KQDate"]);

                DataTable dtQT = new SZHL_KQBCB().GetDTByCommand(strSql2);
                if (dtQT.Rows.Count > 0)
                {
                    row["QTDate"]     = dtQT.Rows[0]["KQDate"];
                    row["QTStatus"]   = dtQT.Rows[0]["Status"];
                    row["QTPosition"] = dtQT.Rows[0]["Position"];
                }
            }
            msg.Result  = dt;
            msg.Result1 = recordCount;
            msg.Result2 = dtTJ;
        }