/// <summary> /// 会议详细信息 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETHYGLMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = int.Parse(P1); string strWhere = " 1=1 and hy.ComId=" + UserInfo.User.ComId + " and hy.ID=" + Id; string colNme = @"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 "; string tableName = string.Format(@" SZHL_HYGL hy left join SZHL_HYGL_ROOM hys on hy.RoomID=hys.ID"); string strSql = string.Format("Select {0} From {1} where {2} order by hy.CRDate desc", colNme, tableName, strWhere); DataTable dt = new SZHL_HYGLB().GetDTByCommand(strSql); msg.Result = dt; if (dt.Rows.Count > 0) { if (dt.Rows[0]["Files"] != null) { string strfiles = dt.Rows[0]["Files"].ToString(); if (!string.IsNullOrEmpty(strfiles)) { msg.Result1 = new FT_FileB().GetEntities(" ID in (" + strfiles + ")"); } } //msg.Result2 = new SZHL_HYGL_QRB().GetEntities(p => p.Status == "0" && p.HYID == model.ID && p.IsDel == 0); //msg.Result3 = new SZHL_HYGL_QDB().GetEntities(p => p.IsDel == 0 && p.HYID == model.ID); var strid = dt.Rows[0]["ID"].ToString(); //打开会议即已阅 //Msg_Result msg2 = new Msg_Result(); //UPDATEHYQK(context, msg2, strid, "1", UserInfo); msg.Result2 = new JH_Auth_TLB().GetEntities(p => p.ComId == UserInfo.User.ComId && p.MSGType == "HYGL" && p.MSGTLYID == strid); 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; } } msg.Result3 = strs; } if (dt.Rows[0]["JLFiles"] != null) { string strjlfiles = dt.Rows[0]["JLFiles"].ToString(); if (!string.IsNullOrEmpty(strjlfiles)) { msg.Result4 = new FT_FileB().GetEntities(" ID in (" + strjlfiles + ")"); } } //更新消息为已读状态 new JH_Auth_User_CenterB().ReadMsg(UserInfo, Int32.Parse(strid), "HYGL"); } }
/// <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; } }