Beispiel #1
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 GETCCXJLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            string userName = UserInfo.User.UserName;
            string strWhere = " 1=1 and cc.ComId=" + UserInfo.User.ComId;

            string leibie = context.Request["lb"] ?? "";

            if (leibie != "")
            {
                strWhere += string.Format(" And cc.LeiBie='{0}' ", leibie);
            }
            string strContent = context.Request["Content"] ?? "";

            strContent = strContent.TrimEnd();
            if (strContent != "")
            {
                strWhere += string.Format(" And ( cc.ZhuYaoShiYou like '%{0}%' )", strContent);
            }
            int DataID = -1;

            int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id
            if (DataID != -1)
            {
                string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("CCXJ", DataID, UserInfo);
                if (strIsHasDataQX == "Y")
                {
                    strWhere += string.Format(" And cc.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, "CCXJ");
                }
                break;

                case "1":     //创建的
                {
                    strWhere += " And cc.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 cc.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 cc.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                    }
                    else
                    {
                        strWhere += " And 1=0";
                    }
                }
                break;
                }
                dt = new SZHL_CCXJB().GetDataPager("SZHL_CCXJ cc left join JH_Auth_ZiDian zd on cc.LeiBie=zd.ID", "cc.*,zd.TypeName ,dbo.fn_PDStatus(cc.intProcessStanceid) AS StateName", pagecount, page, " cc.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;
            }
        }
Beispiel #2
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;
        }
Beispiel #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 GETYCGLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            string userName = UserInfo.User.UserName;
            string strWhere = " 1=1 and yc.ComId=" + UserInfo.User.ComId;

            string leibie = context.Request["lb"] ?? "";

            if (leibie != "")
            {
                strWhere += string.Format(" And yc.CarID='{0}' ", leibie);
            }
            string strContent = context.Request["Content"] ?? "";

            strContent = strContent.TrimEnd();
            if (strContent != "")
            {
                strWhere += string.Format(" And ( yc.Remark like '%{0}%' or yc.StartAddress like '%{0}%' or yc.EndAddress like '%{0}%')", strContent);
            }
            int DataID = -1;

            int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id
            if (DataID != -1)
            {
                string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("YCGL", DataID, UserInfo);
                if (strIsHasDataQX == "Y")
                {
                    strWhere += string.Format(" And yc.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();

                #region no use
                //                switch (P1)
                //                {
                //                    case "0":
                //                        string colNme1 = @"ycgl.*,car.CarBrand,car.CarType,car.CarNum ,    case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null  THEN '正在审批'
                //                                            when wfpi.isComplete='Y' then '已审批'  WHEN wfpi.IsCanceled='Y' then '已退回' END StateName";
                //                        //strWhere += " And cc.CRUser ='******'";
                //                        dt = new SZHL_CCXJB().GetDataPager("SZHL_YCGL ycgl left outer join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID  inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID", colNme1, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                //                        break;
                //                    case "1":
                //                        string colNme = @"ycgl.*,car.CarBrand,car.CarType,car.CarNum ,    case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null  THEN '正在审批'
                //                                            when wfpi.isComplete='Y' then '已审批'  WHEN wfpi.IsCanceled='Y' then '已退回' END StateName";
                //                        strWhere += " And ycgl.CRUser ='******'";
                //                        dt = new SZHL_CCXJB().GetDataPager("SZHL_YCGL ycgl left outer join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID  inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID", colNme, 8, page, " ycgl.CRDate desc", strWhere, ref total);

                //                        break;
                //                    case "2":
                //                        List<string> intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                //                        if (intProD.Count > 0)
                //                        {
                //                            string tableNameD = string.Format(@" SZHL_YCGL ycgl left outer join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID");
                //                            string tableColumnD = "ycgl.* ,car.CarBrand,car.CarType,car.CarNum , '正在审批' StateName";
                //                            strWhere += " And ycgl.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                //                            //string strSql = string.Format("Select {0}  From {1} where {2} order by cc.CRDate desc", tableColumnD, tableNameD, strWhere);
                //                            dt = new SZHL_CCXJB().GetDataPager(tableNameD, tableColumnD, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                //                        }
                //                        break;
                //                    case "3":
                //                        List<Yan_WF_TI> ListData = new Yan_WF_TIB().GetEntities("TaskUserID ='" + UserInfo.User.UserName + "' AND EndTime IS NOT NULL AND TaskUserView!='发起表单'").ToList();
                //                        List<string> intPro = ListData.Select(d => d.PIID.ToString()).ToList();
                //                        string tableName = string.Format(@" SZHL_YCGL ycgl left outer join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID");
                //                        string tableColumn = "ycgl.* ,car.CarBrand,car.CarType,car.CarNum , case when wfpi.IsCanceled is null then '已审批'  WHEN wfpi.IsCanceled='Y' then '已退回' END StateName ";
                //                        strWhere += "  And ycgl.intProcessStanceid in (" + (intPro.ListTOString(',') == "" ? "0" : intPro.ListTOString(',')) + ")";

                //                        dt = new SZHL_CCXJB().GetDataPager(tableName, tableColumn, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                //                        break;
                //                }
                #endregion

                switch (P1)
                {
                case "0":     //手机单条数据
                {
                    //设置usercenter已读
                    new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "YCGL");
                }
                break;

                case "1":     //创建的
                {
                    strWhere += " And yc.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 yc.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 yc.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                    }
                    else
                    {
                        strWhere += " And 1=0";
                    }
                }
                break;
                }

                dt = new SZHL_CCXJB().GetDataPager("SZHL_YCGL yc left join SZHL_YCGL_CAR car on yc.CarID=car.ID", "yc.*,car.CarBrand,car.CarType,car.CarNum ,dbo.fn_PDStatus(yc.intProcessStanceid) AS StateName", pagecount, page, " yc.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;
            }
        }
Beispiel #4
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 GETHYGLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            string userName = UserInfo.User.UserName;
            string strWhere = " 1=1 and hy.ComId=" + UserInfo.User.ComId;

            string leibie = context.Request["lb"] ?? "";

            if (leibie != "")
            {
                strWhere += string.Format(" And hy.RoomID='{0}' ", leibie);
            }
            string strContent = context.Request["Content"] ?? "";

            strContent = strContent.TrimEnd();
            if (strContent != "")
            {
                strWhere += string.Format(" And ( hy.Title like '%{0}%' )", strContent);
            }
            int DataID = -1;

            int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id
            if (DataID != -1)
            {
                string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("HYGL", DataID, UserInfo);
                if (strIsHasDataQX == "Y")
                {
                    strWhere += string.Format(" And hy.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();

                #region no use
                //                switch (P1)
                //                {
                //                    case "0":
                //                        string colNme1 = @"ycgl.*,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行'
                //                                            when ycgl.EndTime<getdate() then '已结束' end as HLStatus,car.Name ,case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null  THEN '正在审批'
                //                                            when wfpi.isComplete='Y' then '已审批'  WHEN wfpi.IsCanceled='Y' then '已退回' END as StateName";
                //                        //strWhere += " And cc.CRUser ='******'";
                //                        dt = new SZHL_CCXJB().GetDataPager("SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM  car on ycgl.RoomID=car.ID  inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID", colNme1, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                //                        break;
                //                    case "1":
                //                        string colNme = @"ycgl.*,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行'
                //                                            when ycgl.EndTime<getdate() then '已结束' end as HLStatus,car.Name ,case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null  THEN '正在审批'
                //                                            when wfpi.isComplete='Y' then '已审批'  WHEN wfpi.IsCanceled='Y' then '已退回' END as StateName";
                //                        strWhere += " And ycgl.CRUser ='******'";
                //                        dt = new SZHL_CCXJB().GetDataPager("SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM  car on ycgl.RoomID=car.ID  inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID", colNme, 8, page, " ycgl.CRDate desc", strWhere, ref total);

                //                        break;
                //                    case "2":
                //                        string colNme2 = @"ycgl.*,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行'
                //                                            when ycgl.EndTime<getdate() then '已结束' end as HLStatus,car.Name ,'已审批' StateName";
                //                        strWhere += string.Format(" And (','+ycgl.CYUser+','  like '%,{0},%' or ','+ycgl.JLUser+','  like '%,{0},%' or ','+ycgl.ZCUser+','  like '%,{0},%' or ','+ycgl.SXUser+','  like '%,{0},%'  ) and wfpi.isComplete='Y'", userName);
                //                        dt = new SZHL_CCXJB().GetDataPager("SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM  car on ycgl.RoomID=car.ID  inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID", colNme2, 8, page, " ycgl.StartTime desc", strWhere, ref total);

                //                        break;
                //                    case "3":
                //                        List<string> intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                //                        if (intProD.Count > 0)
                //                        {
                //                            string tableNameD = string.Format(@" SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM  car on ycgl.RoomID=car.ID");
                //                            string tableColumnD = "ycgl.* ,car.Name , '正在审批' StateName,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行' when ycgl.EndTime<getdate() then '已结束' end as HLStatus";
                //                            strWhere += " And ycgl.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                //                            dt = new SZHL_CCXJB().GetDataPager(tableNameD, tableColumnD, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                //                        }
                //                        break;
                //                    case "4":
                //                        List<Yan_WF_TI> ListData = new Yan_WF_TIB().GetEntities("TaskUserID ='" + UserInfo.User.UserName + "' AND EndTime IS NOT NULL AND TaskUserView!='发起表单'").ToList();
                //                        List<string> intPro = ListData.Select(d => d.PIID.ToString()).ToList();
                //                        string tableName = string.Format(@" SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM  car on ycgl.RoomID=car.ID inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID");
                //                        string tableColumn = "ycgl.* ,car.Name ,  case when wfpi.IsCanceled is null then '已审批'   WHEN wfpi.IsCanceled='Y' then '已退回' END StateName,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行' when ycgl.EndTime<getdate() then '已结束' end as HLStatus ";
                //                        strWhere += "  And ycgl.intProcessStanceid in (" + (intPro.ListTOString(',') == "" ? "0" : intPro.ListTOString(',')) + ")";

                //                        dt = new SZHL_CCXJB().GetDataPager(tableName, tableColumn, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                //                        break;
                //                }
                #endregion

                switch (P1)
                {
                case "0":     //手机单条数据
                {
                    //设置usercenter已读
                    new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "HYGL");
                }
                break;

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

                case "2":     //参与的
                {
                    strWhere += string.Format(" And (','+hy.CYUser+','  like '%,{0},%' or ','+hy.JLUser+','  like '%,{0},%' or ','+hy.ZCUser+','  like '%,{0},%' or ','+hy.SXUser+','  like '%,{0},%'  ) and ( dbo.fn_PDStatus(hy.intProcessStanceid)='已审批' or dbo.fn_PDStatus(hy.intProcessStanceid)='-1')", userName);
                }
                break;

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

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

                dt = new SZHL_CCXJB().GetDataPager("SZHL_HYGL hy left join SZHL_HYGL_ROOM hys on hy.RoomID=hys.ID", "hy.*,hys.Name ,dbo.fn_PDStatus(hy.intProcessStanceid) AS StateName,case when hy.StartTime>getdate() then '即将开始' when hy.StartTime<=getdate() and hy.EndTime>=getdate() then '正在进行' when hy.EndTime<getdate() then '已结束' end as HLStatus ", pagecount, page, " hy.CRDate desc", strWhere, ref total);

                if (dt.Rows.Count > 0)
                {
                    dt.Columns.Add("RYStatus", Type.GetType("System.String"));
                    dt.Columns.Add("FileList", Type.GetType("System.Object"));
                    dt.Columns.Add("PLList", 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() + ")");
                        }
                        string strid = dr["ID"].ToString();
                        var    hysat = new JH_Auth_TLB().GetEntities(p => p.ComId == UserInfo.User.ComId && p.MSGType == "HYGL" && p.MSGTLYID == strid && p.CRUser == UserInfo.User.UserName && p.MsgISShow != null).OrderByDescending(p => p.CRDate).ToList();
                        if (hysat.Count() > 0)
                        {
                            string strs = string.Empty;
                            foreach (var l in hysat)
                            {
                                if (string.IsNullOrEmpty(strs))
                                {
                                    strs = l.MsgISShow;
                                }
                                else
                                {
                                    strs = strs + "," + l.MsgISShow;
                                }
                            }
                            dr["RYStatus"] = strs;
                        }

                        dr["PLList"] = new JH_Auth_TLB().GetEntities(p => p.ComId == UserInfo.User.ComId && p.MSGType == "HYGL" && p.MSGTLYID == strid);
                    }
                }
                msg.Result  = dt;
                msg.Result1 = total;
            }
        }
Beispiel #5
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 GETLCSPLIST(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            string userName = UserInfo.User.UserName;
            string strWhere = " 1=1 and pi.ComId=" + UserInfo.User.ComId;

            string leibie = context.Request("lb") ?? "";

            if (leibie != "")
            {
                strWhere += string.Format(" And pi.PDID='{0}' ", leibie);
                int pdid = int.Parse(leibie);
                msg.Result2 = new Yan_WF_PDB().GetEntity(d => d.ID == pdid);
            }

            int DataID = -1;

            int.TryParse(context.Request("ID") ?? "-1", out DataID);//记录Id
            if (DataID != -1)
            {
                strWhere += string.Format(" And pi.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 "1":     //创建
                {
                    strWhere += " And pi.CRUser ='******'";
                }

                break;

                case "2":     //待审核
                {
                    List <string> intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                    if (intProD.Count > 0)
                    {
                        strWhere += " And pi.ID 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 pi.ID  in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                    }
                    else
                    {
                        strWhere += " and 1=0 ";
                    }
                }
                break;

                case "4":     //抄送我的
                {
                    strWhere += " AND pi.isComplete='Y'    AND   ',' + pi.ChaoSongUser  + ',' like '%," + userName + ",%'";
                }
                break;
                }
                dt = new Yan_WF_PIB().GetDataPager("Yan_WF_PI pi inner join Yan_WF_PD pd on pd.ID=pi.PDID ", "pi.*,pd.ProcessClass, pd.ProcessType,pd.ProcessName,'LCSP' as ModelCode", pagecount, page, " CRDate desc", strWhere, ref total);
                dt.Columns.Add("StatusName");
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int    pid           = int.Parse(dt.Rows[i]["ID"].ToString());
                    string strStatusName = "正在审批";
                    if (dt.Rows[i]["isComplete"].ToString() == "Y")
                    {
                        strStatusName = "已审批";
                    }
                    if (dt.Rows[i]["IsCanceled"].ToString() == "Y")
                    {
                        strStatusName = "已退回";
                    }
                    if (dt.Rows[i]["ProcessType"].ToString() == "-1")
                    {
                        strStatusName = "无流程数据";
                    }
                    dt.Rows[i]["StatusName"] = strStatusName;
                }
                msg.Result  = dt;
                msg.Result1 = total;
            }
        }
Beispiel #6
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 GETYSPYCGLLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            #region 已审核
            List <Yan_WF_TI> ListData = new Yan_WF_TIB().GetEntities("TaskUserID ='" + UserInfo.User.UserName + "' AND EndTime IS NOT NULL AND TaskUserView!='发起表单'").ToList();
            List <string>    intPro   = ListData.Select(d => d.PIID.ToString()).ToList();
            int page = 0;
            int.TryParse(P2, out page);
            page = page == 0 ? 1 : page;
            if (intPro.Count > 0)
            {
                string tableName   = string.Format(@" SZHL_YCGL ycgl inner join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID");
                string tableColumn = "ycgl.* ,car.CarBrand,car.CarType,car.CarNum , case when wfpi.IsCanceled is null then '已审批'  WHEN wfpi.IsCanceled='Y' then '已退回' END StateName ";
                string strWhere    = " ycgl.ComId=" + UserInfo.User.ComId + " And ycgl.intProcessStanceid in (" + intPro.ListTOString(',') + ")";
                if (P1 != "")
                {
                    strWhere += string.Format(" And  ycgl.XCType='{0}'", P1);
                }
                if (P2 != "")
                {
                    strWhere += string.Format(" And  ycgl.Remark like '%{0}%'", P2);
                }

                int total = 0;

                DataTable dt = new SZHL_YCGLB().GetDataPager(tableName, tableColumn, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                msg.Result  = dt;
                msg.Result1 = total;
            }
            #endregion
            #region 待审核
            if (page == 1 && P1 == "" && P2 == "")
            {
                List <string> intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                if (intProD.Count() > 0)
                {
                    string tableNameD   = string.Format(@" SZHL_YCGL ycgl inner join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID");
                    string tableColumnD = "ycgl.* ,car.CarBrand,car.CarType,car.CarNum , '正在审批' StateName";
                    string strWhereD    = " ycgl.ComId=" + UserInfo.User.ComId + " And ycgl.intProcessStanceid in (" + intProD.ListTOString(',') + ")";
                    string strSql       = string.Format("Select {0}  From {1} where {2} order by ycgl.CRDate desc", tableColumnD, tableNameD, strWhereD);
                    msg.Result2 = new SZHL_YCGLB().GetDTByCommand(strSql);
                }
            }
            #endregion
        }
Beispiel #7
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;
        }