/// <summary> /// 获取活动信息 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1">活动报名信息ID</param> /// <param name="P2"></param> /// <param name="strUserName"></param> public void GETQYHDMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = int.Parse(P1); SZHL_QYHDN qyhd = new SZHL_QYHDNB().GetEntity(d => d.ID == Id); msg.Result = qyhd; DataTable dtPL = new SZHL_GZBGB().GetDTByCommand(" SELECT * FROM JH_Auth_TL WHERE MSGType='QYHD' AND MSGTLYID='" + P1 + "'"); 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)); } } msg.Result1 = dtPL; if (!string.IsNullOrEmpty(qyhd.Files)) { int[] fileIds = qyhd.Files.SplitTOInt(','); msg.Result2 = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } msg.Result3 = new SZHL_QYHD_ResultB().GetEntities(d => d.HDID == qyhd.ID); msg.Result4 = new SZHL_QYHD_OptionB().GetEntities(d => d.HDId == qyhd.ID); }
//首页获取任务数据 public void GETRWGLINDEXLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = string.Format(" (bg.CRUser='******' or ','+RWFZR+',' like '%,{0},%' or ','+RWCYR+',' like '%,{0},%' ) ", userName); int recordCount = 0; DataTable dtList = new SZHL_GZBGB().GetDataPager(" SZHL_RWGL bg inner join JH_Auth_ZiDian zd on LeiBie= zd.ID and Class=7 ", "bg.*,zd.TypeName ", 8, 1, "bg.CRDate desc", strWhere + " And RWStatus=0", ref recordCount); DataTable dtList1 = new SZHL_GZBGB().GetDataPager(" SZHL_RWGL bg inner join JH_Auth_ZiDian zd on LeiBie= zd.ID and Class=7 ", "bg.*,zd.TypeName ", 8, 1, "bg.CRDate desc", strWhere + " And RWStatus=1", ref recordCount); msg.Result = dtList; msg.Result1 = dtList1; }
public void GETGZBGMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = 0; int.TryParse(P1, out Id); SZHL_GZBG sg = new SZHL_GZBGB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId); msg.Result = sg; if (sg != null) { msg.Result3 = new JH_Auth_ZiDianB().GetEntity(d => d.ID == sg.LeiBie).TypeName; } DataTable dtPL = new SZHL_GZBGB().GetDTByCommand(" SELECT * FROM JH_Auth_TL WHERE MSGType='GZBG' AND MSGTLYID='" + P1 + "'"); 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)); } } msg.Result1 = dtPL; if (!string.IsNullOrEmpty(sg.Files)) { int[] fileIds = sg.Files.SplitTOInt(','); msg.Result2 = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } //更新消息为已读状态 if (sg != null) { new JH_Auth_User_CenterB().ReadMsg(UserInfo, sg.ID, "GZBG"); } }
public void GETKQINSTALL(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 searchContent = context.Request["search"] ?? ""; string strWhere = " ComID=" + UserInfo.User.ComId; if (!string.IsNullOrEmpty(searchContent)) { strWhere = string.Format(" And KQTitle like '%{0}%'", searchContent); } DataTable dt = new SZHL_GZBGB().GetDataPager(" SZHL_KQBC ", "*", pagecount, page, " CRDate desc ", strWhere, ref recordCount); msg.Result = dt; msg.Result1 = recordCount; }
/// <summary> /// 获取话题BYID /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETHTMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = 0; int.TryParse(P1, out Id); SZHL_TSSQ sg = new SZHL_TSSQB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId); msg.Result = sg; if (sg != null) { if (!string.IsNullOrWhiteSpace(sg.Files)) { msg.Result1 = new FT_FileB().GetEntities(" ID in (" + sg.Files + ")"); } if (sg.LeiBie != null && !string.IsNullOrWhiteSpace(sg.LeiBie.ToString())) { var SS = new JH_Auth_ZiDianB().GetEntity(p => p.ID == sg.LeiBie); if (SS != null) { msg.Result2 = SS.TypeName; } } //msg.Result3 = new JH_Auth_TLB().GetEntities(d => d.ComId == UserInfo.User.ComId && d.MSGType == "TSSQ" && d.MSGTLYID == P1 && (d.MsgISShow != "Y" && d.MsgISShow != "N")).ToList(); DataTable dtPL = new SZHL_GZBGB().GetDTByCommand(" SELECT * FROM JH_Auth_TL WHERE MSGType='TSSQ' AND MSGTLYID='" + P1 + "' and MsgISShow!='Y' and MsgISShow!='N')"); 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)); } } msg.Result3 = dtPL; } }
/// <summary> /// 工作报告统计 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETGZBGTJ(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 starDate = (P1 == "" ? DateTime.Now.Year.ToString() : P1) + "-"; string EndDate = ""; if (P2 == "0" || P2 == "") { starDate = starDate + "01" + "-01"; EndDate = (P1 == "" ? DateTime.Now.Year.ToString() : P1) + "-12" + "-31"; } else { starDate = starDate + P2 + "-01"; EndDate = DateTime.Parse(starDate).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); } string searchContent = context.Request["search"] ?? ""; string strWhere = ""; if (!string.IsNullOrEmpty(searchContent)) { strWhere = string.Format(" And ( BG.CRUserName like '%{0}%' OR BG.BranchName like '%{1}%' )", searchContent, searchContent); } string strSql = string.Format(@"SELECT BG.BranchName,BG.CRUser, zd.TypeName, DATEPART(MONTH,BG.CRDate) ccMonth , COUNT(BG.ID) daycount from SZHL_GZBG BG inner join JH_Auth_ZiDian zd on BG.LeiBie=zd.ID and zd.COMID='{0}' WHERE BG.ComID='{1}' AND BG.RBDate BETWEEN '{2}' and '{3}'" + strWhere + " GROUP by BG.BranchName,BG.CRUser, zd.TypeName, DATEPART(MONTH,BG.CRDate) ", UserInfo.User.ComId, UserInfo.User.ComId, starDate, EndDate); DataTable dt = new SZHL_GZBGB().GetDataPager("(" + strSql + ") as gzbgtjtable ", "*", pagecount, page, " BranchName,CRUser,ccMonth,TypeName ", " 1=1 ", ref recordCount); msg.Result = dt; msg.Result1 = recordCount; }
/// <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; }
public void GETRWGLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = " bg.ComId =" + UserInfo.User.ComId.Value; if (P1 != "") { if (P1 == "2") { // strWhere += string.Format(" And datediff(day,bg.RWJZDate,getdate())>0"); strWhere += string.Format(" And bg.RWJZDate < CONVERT(char(10), GETDATE(), 120) And RWStatus='0'"); } else if (P1 == "1") { strWhere += string.Format(" And RWStatus={0}", P1); } else if (P1 == "0") { //strWhere += string.Format(" And bg.RWJZDate >= CONVERT(char(10), GETDATE(), 120) And RWStatus={0}", P1); strWhere += string.Format(" And RWStatus={0}", P1); } } if (P2 != "") { switch (P2) { case "0": strWhere += string.Format(" And (bg.CRUser='******' or ','+RWFZR+',' like '%,{0},%' or ','+RWCYR+',' like '%,{0},%' or ','+KHFXRS+',' like '%,{0},%' )", userName); break; case "1": strWhere += string.Format(" And (','+RWFZR+',' like '%," + userName + ",%' )"); break; case "2": strWhere += string.Format(" And bg.CRUser='******'", UserInfo.User.UserName); break; case "3": strWhere += string.Format(" And (','+RWCYR+',' like '%," + userName + ",%' )"); break; case "4": strWhere += string.Format(" And (','+KHFXRS+',' like '%," + userName + ",%' )"); break; } } string leibie = context.Request["lb"] ?? ""; if (leibie != "") { strWhere += string.Format(" And LeiBie='{0}' ", leibie); } string strContent = context.Request["Content"] ?? ""; strContent = strContent.TrimEnd(); if (strContent != "") { strWhere += string.Format(" And ( RWTitle like '%{0}%' )", strContent); } //根据时间查询数据 string time = context.Request["time"] ?? ""; if (time != "") { if (time == "1") //近一周 { strWhere += string.Format(" And datediff(day,bg.CRDate,getdate())<7"); } else if (time == "2") { //近一月 strWhere += string.Format(" And datediff(day,bg.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),bg.CRDate,120) >='{0}'", strTime); } if (endTime != "") { strWhere += string.Format(" And convert(varchar(10),bg.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("RWGL", DataID, UserInfo); if (strIsHasDataQX == "Y") { strWhere += string.Format(" And bg.ID = '{0}'", DataID); } //更新消息为已读状态 new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "RWGL"); } 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); //页数 page = page == 0 ? 1 : page; int recordCount = 0; dtList = new SZHL_GZBGB().GetDataPager(" SZHL_RWGL bg LEFT JOIN JH_Auth_ZiDian zd on LeiBie= zd.ID and Class=7 LEFT JOIN JH_Auth_User jau ON bg.RWFZR = jau.UserName AND jau.ComId=bg.ComId ", @" [CRUserName], jau.UserRealName, zd.TypeName, [RWJZDate], [RWTitle], [RWContent], [LeiBie], [RWFZR], [RWCYR], [RWStatus], [BiaoQian], [BeiZhu], [IsSend], [IsComPlete], [IsCancel], [CancelDate], bg.[CRDate], bg.[CRUser], bg.[Files], bg.[Remark], bg.[ID], [intProcessStanceid], [KHFXRS], [TopID], bg.[ComId], [TaskJD], [IsTX],CASE WHEN RWJZDate<CONVERT(char(20), GETDATE(), 23) THEN 1 else 0 END AS jzstatus" , pagecount, page, "bg.RWJZDate desc", strWhere, ref recordCount); string Ids = ""; string fileIDs = ""; foreach (DataRow row in dtList.Rows) { Ids += row["ID"].ToString() + ","; if (!string.IsNullOrEmpty(row["Files"].ToString())) { fileIDs += row["Files"].ToString() + ","; } } Ids = Ids.TrimEnd(','); fileIDs = fileIDs.TrimEnd(','); 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='RWGL' 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(); } dtList.Columns.Add("PLList", Type.GetType("System.Object")); dtList.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow row in dtList.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 = dtList; msg.Result1 = recordCount; }