public object GetData(string userid, string caseId, string baid, string actid) { try { if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid); var data = new GetDataModel(); if (caseId == "") { DeptInfoAndUserInfo userData = ComClass.GetDeptAndUserByUserId(userid); data.sendDocBaseInfo = new B_OA_SendDoc_Inner_QuZhan(); data.sendDocBaseInfo.underTakeManId = userData.userinfo.UserID; data.sendDocBaseInfo.undertakeMan = userData.userinfo.CnName; data.sendDocBaseInfo.underTakeDep = userData.deptinfo.DPName; data.sendDocBaseInfo.underTakeDepId = userData.deptinfo.DPID; B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("flagType = " + "3"); fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType); data.sendDocBaseInfo.fileTypeId = fileType.FileTypeId; } else { B_OA_SendDoc_Inner_QuZhan userData = new B_OA_SendDoc_Inner_QuZhan(); userData.Condition.Add("caseId=" + caseId); userData = Utility.Database.QueryObject<B_OA_SendDoc_Inner_QuZhan>(userData); data.sendDocBaseInfo = userData; } return data; } catch (Exception ex) { ComBase.Logger(ex); throw (new Exception("获取数据失败!", ex)); } }
//通过文章类别ID查找文章类别的根节点,并组成字符串拼接起来 public static B_OA_FileType GetFileTypeByFlayType(string flagType, IDbTransaction tran) { B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("flagType = " + flagType); fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType); return fileType; }
//通过文章类别ID查找文章类别的根节点,并组成字符串拼接起来 public static string getFileTypeNameByFileTypeId(string fileTypeId, IDbTransaction tran) { B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("FileTypeId = " + fileTypeId); fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType); fileTypeName = fileType.FileTypeName + ";" + fileTypeName; if (fileType.ParentId == "0") { return fileTypeName; } else { return getFileTypeNameByFileTypeId(fileType.ParentId, tran); } }
public object GetData(string userid) { var tran = Utility.Database.BeginDbTransaction(); try { StringBuilder strSql = new StringBuilder(); strSql.AppendFormat( @" select newTb.FileTypeId,newTb.name ,newTb.ParentId,newTb.FileTypeName,newTb.CodePath,newTb.sourceType,newTb.linkUrl,newTb.RankID from (SELECT FileTypeId,FileTypeName as name ,ParentId,FileTypeName,CodePath,sourceType,b.linkName as linkUrl,RankID from B_OA_FileType as a LEFT JOIN B_OA_FileType_DefineLink as b on b.id = a.linkId where a.flagType = '1' UNION SELECT FileTypeId,FileTypeName as name ,ParentId,FileTypeName,CodePath ,sourceType,b.linkName as linkUrl,RankID from B_OA_FileType as a LEFT JOIN B_OA_FileType_DefineLink as b on b.id = a.linkId where a.flagType = '2' UNION SELECT FileTypeId,FileTypeName as name ,ParentId,FileTypeName,CodePath ,sourceType,b.linkName as linkUrl,RankID from B_OA_FileType as a LEFT JOIN B_OA_FileType_DefineLink as b on b.id = a.linkId where ParentId in (SELECT FileTypeId from B_OA_FileType where flagType = '1' or flagType = '2') ) as newTb order by newTb.ParentId asc,newTb.RankID asc "); DataTable dataTable = Utility.Database.ExcuteDataSet(strSql.ToString(), tran).Tables[0]; B_OA_FileType fileModel = new B_OA_FileType(); ; return new { dataTable = dataTable, fileModel = fileModel }; } catch (Exception e) { Utility.Database.Rollback(tran); throw (new Exception("获取数据失败!", e)); } }
public string DeleteData(string id, string userid) { var tran = Utility.Database.BeginDbTransaction(); try { B_OA_FileType fileType = new B_OA_FileType(); if (string.IsNullOrEmpty(id)) { fileType.Condition.Add("FileTypeId=" + id); Utility.Database.Delete(fileType, tran); } Utility.Database.Commit(tran); return Utility.JsonMsg(true, "删除除数据成功"); } catch (Exception e) { Utility.Database.Rollback(tran); throw (new Exception("获取数据失败!", e)); } }
/// <summary> /// 查找已经 /// </summary> /// <param name="fileTypeId"></param> /// <param name="top">前几条数据</param> /// <param name="userid">用户id</param> /// <param name="hasChecked">是否查找已经审核通过的数据</param> /// <param name="usePrevige">是否通过使用权限过滤</param> /// <param name="tran"></param> /// <returns></returns> public DataTable GetArtistByFileTypeId(string fileTypeId, string top, string userid, string status, string publicRange, bool usePrevige, IDbTransaction tran) { StringBuilder strSql = new StringBuilder(); string d = ""; if (fileTypeId != "0") { B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("FileTypeId =" + fileTypeId); fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType, tran); listSon = new List<B_OA_FileType>(); if (fileType.isParent == false) { listSon.Add(fileType); } else { GetFileSonList(fileType, tran); } strSql.Clear(); for (var j = 0; j < listSon.Count; j++) { if (j == (listSon.Count - 1)) { d = d + "'" + listSon[j].FileTypeId + "'"; } else { d = d + "'" + listSon[j].FileTypeId + "'" + ","; } } } //条件 StringBuilder condition = new StringBuilder(); if (usePrevige == true) { //判断权限 string priName = CommonFunctional.JudgeMan(userid, tran); //全局权限 if (priName == "all") { condition.AppendFormat(""); } else if (priName == "dep") //部门权限 { condition.AppendFormat(" and d.DPID = '{0}'", ComClass.GetUserInfo(userid).DPID); } else if (priName == "single") //个权限 { condition.AppendFormat(" and c.UserId = '{0}'", userid); } } //审核状态 if (!string.IsNullOrEmpty(status)) { condition.AppendFormat(" and c.status ='{0}'", status); } //是否限定查找的发布范围 if (!string.IsNullOrEmpty(publicRange)) { condition.AppendFormat(" and (publicRange = '0' or (publicRange = '1' and rangeCheckManId like '%{0}%'))", userid); } strSql.AppendFormat(@" select {0} d.DPID,c.NewsId,c.NewsTitle,CreateTime,b.fileTypeId,d.CnName as CreateMan,c.documentTypeName,c.documentTypeId , case when c.status='1' then '已通过' else '未通过' end as status from B_OA_FileType as a LEFT JOIN B_OA_Notice_FileType_R as b on a.FileTypeId = b.fileTypeId LEFT JOIN B_OA_Notice as c on b.noticeId = c.NewsId LEFT JOIN FX_UserInfo as d on d.UserID = c.CreaterId where c.NewsId is not null {1} ", top, condition.ToString()); if (d.Length > 0) { strSql.AppendFormat(@" and b.fileTypeId in ({0})", d); } strSql.Append(@" ORDER BY CreateTime desc"); DataSet dataSet = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); return dataSet.Tables[0]; }
private void GetFileFatherList(B_OA_FileType file, IDbTransaction tran) { if (file.ParentId != "0") { B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("FileTypeId = " + file.ParentId); fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType, tran); listFather.Add(fileType); GetFileFatherList(fileType, tran); } }
public object SaveFileType(string JsonData, string Parent, string userid) { var tran = Utility.Database.BeginDbTransaction(); try { B_OA_FileType fileType = JsonConvert.DeserializeObject<B_OA_FileType>(JsonData); if (fileType.FileTypeName == "") { return Utility.JsonMsg(false, "文件名不能为空!"); } if (fileType.FileTypeId == null || fileType.FileTypeId == "") { fileType.FileTypeId = ComClass.GetGuid(); fileType.CreateDate = DateTime.Now.ToString(); fileType.isParent = false; //fileType.CodePath = fileType.CodePath + "/" + fileType.FileTypeId; Utility.Database.Insert(fileType, tran); //修改父类节点中的某个字段 用来判断是否有子节点的 B_OA_FileType p_FileType = new B_OA_FileType(); p_FileType.Condition.Add("FileTypeId =" + fileType.ParentId); B_OA_FileType paren = Utility.Database.QueryObject<B_OA_FileType>(p_FileType); if (paren != null) { paren.isParent = true; paren.Condition.Add("FileTypeId=" + paren.FileTypeId); Utility.Database.Update(paren, tran); } } else { fileType.Condition.Add("FileTypeId = " + fileType.FileTypeId); Utility.Database.Update(fileType); } //返回目录表 StringBuilder strSql = new StringBuilder(); strSql.AppendFormat(@" SELECT a.*, CASE WHEN a.isEffective = '1' THEN '有效' WHEN a.isEffective = '0' THEN '无效' ELSE '未知' END AS isEffectiveName, FileTypeName AS name, b.name AS linkName, b.linkName AS linkUrl FROM B_OA_FileType AS a LEFT JOIN B_OA_FileType_DefineLink AS b ON a.linkId = b.id where FileTypeId = '{0}'", fileType.FileTypeId); DataSet dataSet = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); DataTable dataTable = dataSet.Tables[0]; Utility.Database.Commit(tran); return new { dataTable = dataTable }; } catch (Exception ex) { Utility.Database.Rollback(tran); throw (new Exception("获取数据失败!", ex)); } }
public string GetUserGateForType(string top, string documentType, string userId) { var tran = Utility.Database.BeginDbTransaction(); StringBuilder strSql = new StringBuilder(); DataSet dataSet = new DataSet(); string documentTypeName = ""; B_OA_FileType fileType = new B_OA_FileType(); GetDataModel dataModel = new GetDataModel(); dataModel.fileTypeModel = new B_OA_FileType(); try { //if (documentType == "tongzhigonggao") //{ // documentTypeName = "通知公告"; //} //else if (documentType == "dashiji") //{ // documentTypeName = "环保大事记"; //} //else if (documentType == "xinxifabu") //{ // documentTypeName = "信息发布"; //} //else if (documentType == "zhengqiuyijian") //{ // documentTypeName = "征求意见"; //} fileType.Condition.Add("FileTypeName = " + documentType); dataModel.fileTypeModel = Utility.Database.QueryObject<B_OA_FileType>(fileType, tran); strSql.AppendFormat(@"select top {0} NewsId,NewsTitle,convert(varchar(20),CreateTime,23) as CreateTime from B_OA_Notice where isSeeInDoor = 1 and status='checkThrough' and documentTypeName like '%{1}%' order by CreateTime desc", top, documentType); dataSet = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); dataModel.dataTable = dataSet.Tables[0]; Utility.Database.Commit(tran); //提交事务 return JsonConvert.SerializeObject( dataModel); //将对象转为json字符串并返回到客户端 } catch (Exception ex) { Utility.Database.Rollback(tran); ComBase.Logger(ex); //写异常日志到本地文件夹 return Utility.JsonMsg(false, ex.Message); //将对象转为json字符串并返回到客户端 } }
public string GetFiletypeByFileTypeName(string documentType) { var tran = Utility.Database.BeginDbTransaction(); try { GetDataModel dataModel = new GetDataModel(); dataModel.fileTypeModel = new B_OA_FileType(); B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("FileTypeName = " + documentType); dataModel.fileTypeModel = Utility.Database.QueryObject<B_OA_FileType>(fileType, tran); Utility.Database.Commit(tran); //提交事务 return JsonConvert.SerializeObject( dataModel); //将对象转为json字符串并返回到客户端 } catch (Exception ex) { Utility.Database.Rollback(tran); ComBase.Logger(ex); //写异常日志到本地文件夹 return Utility.JsonMsg(false, ex.Message); //将对象转为json字符串并返回到客户端 } }
public string Send(string BizParams, string userid, string content) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); SkyLandDeveloper developer = new SkyLandDeveloper(BizParams, userid, tran); try { GetDataModel data = JsonConvert.DeserializeObject<GetDataModel>(content); string caseid = developer.caseid; if (String.IsNullOrEmpty(caseid)) { string unitName = data.baseInfo.wjmc; string titleType = "来文"; developer.caseName = unitName + "-" + titleType; caseid = developer.Create(); } if (developer.wfcase.actid == "A001") { //来文编号 B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("FileTypeId =" + data.baseInfo.lwdwTypeId); fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType, tran); int code = int.Parse(fileType.remark) + 1; fileType.remark = code.ToString(); fileType.Condition.Add("FileTypeId =" + data.baseInfo.lwdwTypeId); Utility.Database.Update(fileType, tran); data.baseInfo.code = data.baseInfo.code + "-" + code; } SaveData(data, tran, caseid); //SetCaseName(data, developer); developer.Send(); developer.Commit(); return Utility.JsonMsg(true, "发送成功!"); } catch (Exception ex) { developer.RollBack(); ComBase.Logger(ex); throw (new Exception("业务发送失败!", ex)); } }
public string FilePlaceS(string caseid, string title, string userid) { var tran = Utility.Database.BeginDbTransaction(); string DPName = "";//部门名称 string DPID = "";//部门ID string CnName = "";//归档人姓名 string AttachmentType = "";//归档文件夹ID string saveFileName = "";//需要存档的文件夹名称 string dir = ""; string UserID = ""; try { dir = AppDomain.CurrentDomain.BaseDirectory;//获取应用程序跟目录 StringBuilder strSql = new StringBuilder(); strSql.AppendFormat("select * from FX_AttachMent where CaseID='{0}' and FileName like '归档_%'", caseid); DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); string jsonData = JsonConvert.SerializeObject(ds.Tables[0]); List<FX_AttachMent> list_fx = (List<FX_AttachMent>)JsonConvert.DeserializeObject(jsonData, typeof(List<FX_AttachMent>)); if (list_fx.Count == 0) { return Utility.JsonResult(false, "没有归档文件,请上传归档文件"); } if (list_fx.Count > 1) { return Utility.JsonResult(false, "该文有两份归档文件,无法归档"); } saveFileName = DateTime.Now.ToString("yyyy年MM月dd日 HH时mm分ss秒") + list_fx[0].FileName; //取出部门id var userInfo = ComClass.GetUserInfo(userid); DPID = userInfo.DPID; CnName = userInfo.CnName; UserID = userInfo.UserID; //查找部门ID FX_Department department = new FX_Department(); department.Condition.Add("DPID=" + userInfo.DPID); FX_Department department_ad = Utility.Database.QueryList<FX_Department>(department, tran)[0]; DPName = department_ad.DPName; //归档文件夹ID B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("FileTypeName=" + "发文归档"); List<B_OA_FileType> listFileType = Utility.Database.QueryList<B_OA_FileType>(fileType, tran); if (listFileType.Count <= 0) { return Utility.JsonResult(false, "文档中心分类中未有“发文归档”文档,请联系管理员添加"); } B_OA_FileType fileType_ad = listFileType[0]; AttachmentType = fileType_ad.FileTypeId; //保存文档 B_OA_Notice newNotice = new B_OA_Notice(); newNotice.NewsTitle = title;//文档标题 newNotice.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");//现在时间 newNotice.documentTypeId = AttachmentType;//文档类型id newNotice.CreateMan = CnName; //创建人 newNotice.CreaterId = userid;//创建人ID newNotice.AttachmentName = "attachment/documentCenter/" + saveFileName;//保存文件路径 newNotice.ShareAttachment = "0";//是否共享文件 newNotice.Chk = "0";//是否已经审核 newNotice.ChkM = CnName + ";";//审核人 newNotice.Chkdate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");//审核时间 newNotice.documentTypeName = "办公室;收发文归档;发文归档;";//文件文档分类名 newNotice.NewsId = ComClass.GetGuid(); newNotice.publicRange = 0;//所有人查看 newNotice.isReadRecord = true;//查看记录 newNotice.isTextSuggetion = true;//可以发表意见 newNotice.status = "waitCheck";//审核状态待审核 newNotice.ChkMId = UserID + ";"; string path = dir + "attachment\\documentCenter\\"; if (Directory.Exists(path) == false)//如果不存在就创建文件夹 { Directory.CreateDirectory(path); } //取出文件并保存到相应目录中 File.Copy(dir + "附件目录\\" + list_fx[0].FilePath, path + saveFileName, true); Utility.Database.Insert<B_OA_Notice>(newNotice, tran); //插入审核记录 //取出审核人ID数组 string[] checkManId = newNotice.ChkMId.Split(';'); //插入审核表,用于文章修改后,或者新生成的文章审核 for (int i = 0; i < checkManId.Length - 1; i++) { B_OA_Notice_Addvice addvice = new B_OA_Notice_Addvice(); var user_check = ComClass.GetUserInfo(checkManId[i]); //审核人ID addvice.chkId = checkManId[i]; //审核人姓名 addvice.chkName = user_check.CnName; //审核状态为未审核 addvice.statuType = "waitcheck"; //审核状态名称 addvice.statusName = "待审核"; //文章表外键 addvice.noticeId = newNotice.NewsId; Utility.Database.Insert(addvice, tran); } //插入文件夹附件表 //B_OA_FileList newFileList = new B_OA_FileList(); //newFileList.NewsId = ComClass.GetGuid(); //newFileList.FileName = saveFileName; //newFileList.RelativePath = "attachment/fileDocument/" + saveFileName; //string a = dir.Replace("\\", "/"); //newFileList.AbsolutePath = a + saveFileName; //newFileList.Extension = saveFileName.Split('.')[1]; //newFileList.FileSize = 0; //newFileList.BeforeFileName = list_fx[0].FileName; //newFileList.Dept = DPID; //Utility.Database.Insert<B_OA_FileList>(newFileList, tran); //修改收文的归档状态 B_OA_SendDoc sendDoc = new B_OA_SendDoc(); sendDoc.Condition.Add("caseid=" + caseid); B_OA_SendDoc sendDoc_ad = Utility.Database.QueryList<B_OA_SendDoc>(sendDoc, tran)[0]; sendDoc_ad.sfgd = 1;//修改归档状态为已归档 Utility.Database.Update(sendDoc_ad, tran); Utility.Database.Commit(tran); return Utility.JsonResult(true, "归档成功,此文档上传的归档附件可在文档中心的“办公室》收发文归档》发文归档”文件夹中看到"); } catch (Exception e) { Utility.Database.Rollback(tran); return Utility.JsonResult(false, "数据加载失败!异常信息: " + e.Message); } }
public object SaveFileType(string content, string userid) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); try { B_OA_FileType fileType = JsonConvert.DeserializeObject<B_OA_FileType>(content); if (string.IsNullOrEmpty(fileType.FileTypeId)) { B_OA_FileType p_type = new B_OA_FileType(); p_type.Condition.Add("flagType = " + "3"); p_type = Utility.Database.QueryObject<B_OA_FileType>(p_type, tran); fileType.FileTypeId = ComClass.GetGuid(); fileType.ParentId = p_type.FileTypeId; fileType.CodePath = p_type.CodePath + "/" + fileType.FileTypeId; fileType.isParent = false; fileType.OrderBy = 0; fileType.CreateDate = DateTime.Now.ToString(); fileType.canDelete = false; Utility.Database.Insert(fileType, tran); } else { B_OA_FileType fileType_Edit = new B_OA_FileType(); fileType_Edit.Condition.Add("FileTypeId =" + fileType.FileTypeId); fileType_Edit = Utility.Database.QueryObject<B_OA_FileType>(fileType_Edit, tran); fileType.FileTypeName = fileType.FileTypeName; Utility.Database.Insert(fileType_Edit, tran); } Utility.Database.Commit(tran); return Utility.JsonMsg(true, "删除成功!"); } catch (Exception ex) { ComBase.Logger(ex); throw (new Exception("获取数据失败!", ex)); } }
public object GetSendDocTree(string userid) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); StringBuilder strSql = new StringBuilder(); try { DataTable dataTable = CommonFunctional.GetFileTypeByFlag("3",tran); B_OA_FileType fileType = new B_OA_FileType(); return new { dataTable = dataTable, fileType = fileType }; } catch (Exception ex) { ComBase.Logger(ex); throw (new Exception("获取数据失败!", ex)); } }
public string GetDocumentCenterByFileTypeId(string fileTypeId, string userid) { GetDataModel dataModel = new GetDataModel(); dataModel.listObj = new List<object>(); var tran = Utility.Database.BeginDbTransaction(); StringBuilder strSql = new StringBuilder(); List<B_OA_FileType> listFileType = new List<B_OA_FileType>(); try { B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("FileTypeId =" + fileTypeId); B_OA_FileType file = Utility.Database.QueryObject<B_OA_FileType>(fileType, tran); //便利所有导航 dataModel.listBread = new List<B_OA_FileType>(); //导航栏 B_OA_FileType firstBread = new B_OA_FileType(); //第一个字段的导航默认为全区信息 firstBread.FileTypeId = "0"; firstBread.FileTypeName = "文档分类"; dataModel.listBread.Add(firstBread); if (fileTypeId != "0") { listFather = new List<B_OA_FileType>(); GetFileFatherList(file, tran); if (listFather.Count > 0) { for (int i = listFather.Count - 1; i >= 0; i--) { dataModel.listBread.Add(listFather[i]); } } dataModel.listBread.Add(file); } //查找旗下的子类目录 strSql.AppendFormat("select * from B_OA_FileType where ParentId = '{0}'", fileTypeId); DataSet dataSet = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); string jsonData = JsonConvert.SerializeObject(dataSet.Tables[0]); listFileType = (List<B_OA_FileType>)JsonConvert.DeserializeObject(jsonData, typeof(List<B_OA_FileType>)); //遍历出所有子类包含有的文章 for (int i = 0; i < listFileType.Count; i++) { string jsonData_Notice = JsonConvert.SerializeObject(GetArtistByFileTypeId(listFileType[i].FileTypeId, "Top 5", userid, null, null, true, tran)); List<B_OA_Notice> listNotice = new List<B_OA_Notice>(); listNotice = (List<B_OA_Notice>)JsonConvert.DeserializeObject(jsonData_Notice, typeof(List<B_OA_Notice>)); B_OA_DocumentCenter documentCenter = new B_OA_DocumentCenter(); documentCenter.fileType = listFileType[i]; documentCenter.listNotice = listNotice; dataModel.listObj.Add(documentCenter); } Utility.Database.Commit(tran); return JsonConvert.SerializeObject( dataModel); //将对象转为json字符串并返回到客户端 } catch (Exception ex) { Utility.Database.Rollback(tran); ComBase.Logger(ex); //写异常日志到本地文件夹 throw (new Exception("获取数据失败!", ex)); } }
public void GetFileSonList(B_OA_FileType file, IDbTransaction tran) { if (file.isParent == true) { List<B_OA_FileType> listArray = new List<B_OA_FileType>(); file.Condition.Add("ParentId = " + file.FileTypeId); listArray = Utility.Database.QueryList<B_OA_FileType>(file, tran); for (int i = 0; i < listArray.Count; i++) { listSon.Add(listArray[i]); GetFileSonList(listArray[i], tran); } } }
/// <summary> /// 通过分类ID查找文章 /// </summary> /// <param name="fileTypeId"></param> /// <param name="tran"></param> /// <returns></returns> public DataTable GetArtistByFileTypeId(string fileTypeId, string top, IDbTransaction tran) { StringBuilder strSql = new StringBuilder(); string d = ""; if (fileTypeId != "0") { B_OA_FileType fileType = new B_OA_FileType(); fileType.Condition.Add("FileTypeId =" + fileTypeId); fileType = Utility.Database.QueryObject<B_OA_FileType>(fileType, tran); listSon = new List<B_OA_FileType>(); if (fileType.isParent == false) { listSon.Add(fileType); } else { GetFileSonList(fileType, tran); } strSql.Clear(); for (var j = 0; j < listSon.Count; j++) { if (j == (listSon.Count - 1)) { d = d + "'" + listSon[j].FileTypeId + "'"; } else { d = d + "'" + listSon[j].FileTypeId + "'" + ","; } } } strSql.AppendFormat(@" select {0} c.NewsId,c.NewsTitle,CreateTime,b.fileTypeId,d.CnName as CreateMan,c.documentTypeName,c.documentTypeId , case when c.status='1' then '已通过' else '未通过' end as status from B_OA_FileType as a LEFT JOIN B_OA_Notice_FileType_R as b on a.FileTypeId = b.fileTypeId LEFT JOIN B_OA_Notice as c on b.noticeId = c.NewsId LEFT JOIN FX_UserInfo as d on d.UserID = c.CreaterId where 1=1 and c.NewsId is not null ", top); if (d.Length > 0) { strSql.AppendFormat(@" and b.fileTypeId in ({0})", d); } strSql.Append(@" ORDER BY CreateTime desc"); DataSet dataSet = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); return dataSet.Tables[0]; }