public object GetData(string userid, string caseId, string baid) { try { //只有待办箱才有设置为已读 if (!String.IsNullOrEmpty(baid)) engineAPI.SetIsReaded(caseId, baid, userid); GetDataModel data = new GetDataModel(); B_OA_SendDoc_Science en = new B_OA_SendDoc_Science(); en.Condition.Add("caseid=" + caseId); data.sendDocBaseInfo = Utility.Database.QueryObject<B_OA_SendDoc_Science>(en); if (data.sendDocBaseInfo == null) { var baseInfo = new B_OA_SendDoc_Science(); baseInfo.sendDate = DateTime.Now; baseInfo.createManId = userid; //baseInfo.gklx = "1";//公开类型默认为主动公开 data.sendDocBaseInfo = baseInfo; } return data; } catch (Exception ex) { ComBase.Logger(ex); throw (new Exception("获取数据失败!", ex)); } }
/// <summary> /// 创建一个Word数据 /// </summary> /// <param name="caseid"></param> /// <returns></returns> private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran) { StringBuilder strSql = new StringBuilder(); B_OA_SendDoc_Science boacd = new B_OA_SendDoc_Science(); boacd.Condition.Add("caseid = " + caseid);//设置查询条件 boacd = Utility.Database.QueryObject<B_OA_SendDoc_Science>(boacd); // 发文 Dictionary<string, Object> dict = new Dictionary<string, Object>(); dict.Add("title", boacd.title); dict.Add("mainDelivery", boacd.mainDelivery); dict.Add("cc", boacd.cc); dict.Add("copyAndrecord", boacd.copyAndrecord); dict.Add("printCount", boacd.printCount.ToString()); dict.Add("ngr", boacd.createManName); //评阅意见的插入 #region FX_WorkFlowBusAct work = new FX_WorkFlowBusAct(); work.Condition.Add("CaseID = " + caseid); work.OrderInfo = "ReceDate asc"; List<FX_WorkFlowBusAct> listWork = Utility.Database.QueryList<FX_WorkFlowBusAct>(work, tran); //将所有工作流信息格式化 List<B_OA_PrintParagragh> listPara = CommonFunctional.ChangeListToMatch(listWork); List<B_OA_PrintParagragh> hgrList = new List<B_OA_PrintParagragh>(); List<B_OA_PrintParagragh> qfList = new List<B_OA_PrintParagragh>(); //领导批示 for (int i = 0; i < listPara.Count; i++) { // 拟稿人 if (listPara[i].ActID == "A002") { hgrList.Add(listPara[i]); } //签发 else if (listPara[i].ActID == "A003") { qfList.Add(listPara[i]); } } int k = 0; //核稿人 var imgHgrList = new OpenXmlHelper.ImageTextArray[hgrList.Count]; for (k = 0; k < hgrList.Count; k++) { imgHgrList[k] = new OpenXmlHelper.ImageTextArray(); imgHgrList[k].Images = hgrList[k].Image; imgHgrList[k].Text = hgrList[k].Text; imgHgrList[k].Foots = hgrList[k].Foots; imgHgrList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("hgr", imgHgrList); //签发人 var imgQfList = new OpenXmlHelper.ImageTextArray[qfList.Count]; for (k = 0; k < qfList.Count; k++) { imgQfList[k] = new OpenXmlHelper.ImageTextArray(); imgQfList[k].Images = qfList[k].Image; imgQfList[k].Text = qfList[k].Text; imgQfList[k].Foots = qfList[k].Foots; imgQfList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("qfr", imgQfList); #endregion return dict; }