public string GetWorkFlowCaseByCaseId(string caseId) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); GetDataModel dataModel = new GetDataModel(); try { FX_WorkFlowBusAct work = new FX_WorkFlowBusAct(); work.Condition.Add("CaseID = " + caseId); dataModel.listWorkFlow = Utility.Database.QueryList<FX_WorkFlowBusAct>(work, tran); //读取签发 DataTable dataTable = ComClass.GetSighture(caseId, "0", tran); string jsonData = JsonConvert.SerializeObject(dataTable); List<B_OA_Sighture> listSighture = (List<B_OA_Sighture>)JsonConvert.DeserializeObject(jsonData, typeof(List<B_OA_Sighture>)); dataModel.listSighture = listSighture; Utility.Database.Commit(tran); return JsonConvert.SerializeObject( dataModel);//将对象转为json字符串并返回到客户端 } catch (Exception ex) { ComBase.Logger(ex); return Utility.JsonMsg(false, "发送失败:" + ex.Message.Replace(":", " ")); } }
private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran) { B_OA_SendDoc_Inner_QuZhan sendDoc = new B_OA_SendDoc_Inner_QuZhan(); sendDoc.Condition.Add("caseid=" + caseid); sendDoc = Utility.Database.QueryObject<B_OA_SendDoc_Inner_QuZhan>(sendDoc, tran); Dictionary<string, Object> dict = new Dictionary<string, Object>(); dict.Add("code", sendDoc.code == null ? "" : sendDoc.code);//编号 dict.Add("underTakeDep", sendDoc.underTakeDep == null ? "" : sendDoc.underTakeDep);//承办科室 dict.Add("undertakeMan", sendDoc.undertakeMan == null ? "" : sendDoc.undertakeMan);//承办人 dict.Add("content", sendDoc.content == null ? "" : sendDoc.content);//内容 dict.Add("title", sendDoc.title == null ? "" : sendDoc.title);//内容 dict.Add("remark", sendDoc.remark == null ? "" : sendDoc.remark);//备注 if (!string.IsNullOrEmpty(sendDoc.createDate.ToString())) { string createDate = (DateTime.Parse(sendDoc.createDate.ToString())).ToString("yyyy年MM月dd日"); dict.Add("createDate", createDate);//主送 } //获取所有评阅意见 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> cbksfzryjList = new List<B_OA_PrintParagragh>(); //会办单位意见 List<B_OA_PrintParagragh> hqksyjList = new List<B_OA_PrintParagragh>(); //站领导批示 List<B_OA_PrintParagragh> zldpsList = new List<B_OA_PrintParagragh>(); int k = 0; //承办科室负责人意见 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A002") { cbksfzryjList.Add(listPara[k]); } } //承办科室负责人 var imgCbksfzryjList = new OpenXmlHelper.ImageTextArray[cbksfzryjList.Count]; for (k = 0; k < cbksfzryjList.Count; k++) { imgCbksfzryjList[k] = new OpenXmlHelper.ImageTextArray(); imgCbksfzryjList[k].Images = cbksfzryjList[k].Image; imgCbksfzryjList[k].Text = cbksfzryjList[k].Text; imgCbksfzryjList[k].Foots = cbksfzryjList[k].Foots; imgCbksfzryjList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("cbksfzryj", imgCbksfzryjList); //会办单位意见 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A003") { hqksyjList.Add(listPara[k]); } } //承办科室负责人 var imgHqksyjList = new OpenXmlHelper.ImageTextArray[hqksyjList.Count]; for (k = 0; k < hqksyjList.Count; k++) { imgHqksyjList[k] = new OpenXmlHelper.ImageTextArray(); imgHqksyjList[k].Images = hqksyjList[k].Image; imgHqksyjList[k].Text = hqksyjList[k].Text; imgHqksyjList[k].Foots = hqksyjList[k].Foots; imgHqksyjList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("hqksyj", imgHqksyjList); // for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A004") { zldpsList.Add(listPara[k]); } } //承办科室负责人 var imgZldpsList = new OpenXmlHelper.ImageTextArray[zldpsList.Count]; for (k = 0; k < zldpsList.Count; k++) { imgZldpsList[k] = new OpenXmlHelper.ImageTextArray(); imgZldpsList[k].Images = zldpsList[k].Image; imgZldpsList[k].Text = zldpsList[k].Text; imgZldpsList[k].Foots = zldpsList[k].Foots; imgZldpsList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("zldps", imgZldpsList); return dict; }
/// <summary> /// 创建一个Word数据 /// </summary> /// <param name="caseid"></param> /// <returns></returns> private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran) { B_OA_Car car = new B_OA_Car(); car.Condition.Add("workflowcaseid=" + caseid); car = Utility.Database.QueryObject<B_OA_Car>(car, tran); Dictionary<string, Object> dict = new Dictionary<string, Object>(); //申请部门 dict.Add("applyDepartment", car.applyDepartment == null ? "" : car.applyDepartment); //出车时间 if (!string.IsNullOrEmpty(car.strartTime.ToString())) { string createDate = (DateTime.Parse(car.strartTime.ToString())).ToString("yyyy年MM月dd日 hh时"); dict.Add("strartTime", createDate);//主送 } if (!string.IsNullOrEmpty(car.endTime.ToString())) { string createDate = (DateTime.Parse(car.endTime.ToString())).ToString("yyyy年MM月dd日 hh时"); dict.Add("endTime", createDate);//主送 } //出差地点 dict.Add("strarDestination", car.strarDestination == null ? "" : car.strarDestination); dict.Add("endDestination", car.endDestination == null ? "" : car.endDestination); //出差事由 dict.Add("travelReson", car.travelReson == null ? "" : car.travelReson); //用车人名单 dict.Add("personList", car.personList == null ? "" : car.personList); //用车联系人 dict.Add("useMan", car.useMan == null ? "" : car.useMan); //用车联系人电话 dict.Add("useManPhone", car.useManPhone == null ? "" : car.useManPhone); //驾驶员名字 dict.Add("diverMan", car.diverMan == null ? "" : car.diverMan); //派出车辆 dict.Add("carName", car.carName == null ? "" : car.carName); //备注 dict.Add("remark", car.remark == null ? "" : car.remark); //获取所有评阅意见 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> officeSugList = new List<B_OA_PrintParagragh>(); int k = 0; //办公室核稿意见 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A002") { officeSugList.Add(listPara[k]); } } //办公室核稿意见 var imgOfficeSugListList = new OpenXmlHelper.ImageTextArray[officeSugList.Count]; for (k = 0; k < officeSugList.Count; k++) { imgOfficeSugListList[k] = new OpenXmlHelper.ImageTextArray(); imgOfficeSugListList[k].Images = officeSugList[k].Image; imgOfficeSugListList[k].Text = officeSugList[k].Text; imgOfficeSugListList[k].Foots = officeSugList[k].Foots; imgOfficeSugListList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("officeSug", imgOfficeSugListList); return dict; }
/// <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; }
/// <summary> /// 创建一个Word数据 /// </summary> /// <param name="caseid"></param> /// <returns></returns> private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran, string fwzh) { B_OA_SendDoc boacd = new B_OA_SendDoc(); boacd.Condition.Add("caseid = " + caseid);//设置查询条件 boacd = Utility.Database.QueryObject<B_OA_SendDoc>(boacd); FX_WorkFlowBusAct wfba = new FX_WorkFlowBusAct(); wfba.Condition.Add("CaseID = " + caseid);//设置查询条件 List<FX_WorkFlowBusAct> wfbaList = Utility.Database.QueryList(wfba); var boacdmjsql = @"select a.csz as id, a.mc as mc from Para_BizTypeItem a , Para_BizTypeDictionary b where a.flid = b.id and b.lx = 'mjTypeDic' and a.csz =" + boacd.mj; DataSet boacdmjds = Utility.Database.ExcuteDataSet(boacdmjsql); // 发文 Dictionary<string, Object> dict = new Dictionary<string, Object>(); dict.Add("caseid", boacd.caseid == "" ? "" : boacd.caseid);//业务ID dict.Add("fwrq", boacd.fwrq == null ? "" : Convert.ToDateTime(boacd.fwrq).ToString("yyyy-MM-dd"));//发文日期 dict.Add("wjbh", boacd.wjbh == "" ? "" : boacd.wjbh);//文件编号 dict.Add("fwzh", fwzh); dict.Add("fwlx", boacd.fwlx == "" ? "" : boacd.fwlx);//发文类型 dict.Add("mj", boacdmjds.Tables.Count > 0 ? (boacdmjds.Tables[0].Rows.Count > 0 ? boacdmjds.Tables[0].Rows[0]["mc"] : "") : ""); //密级 //处理显示名称 dict.Add("ys", boacd.ys == "" ? "" : boacd.ys);//印数 //公开程度 DataSet gkcdgkcdds = new DataSet(); var gkcdgkcdsql = ""; if (boacd.gkcd != null) { gkcdgkcdsql = @"select a.csz as id, a.mc as mc from Para_BizTypeItem a , Para_BizTypeDictionary b where a.flid = b.id and b.lx = 'gkcdTypeDic' and a.csz =" + boacd.gkcd; gkcdgkcdds = Utility.Database.ExcuteDataSet(gkcdgkcdsql); dict.Add("gkcd", gkcdgkcdds.Tables.Count > 0 ? (gkcdgkcdds.Tables[0].Rows.Count > 0 ? gkcdgkcdds.Tables[0].Rows[0]["mc"] : "") : ""); //公开程度 } else { dict.Add("gkcd", ""); } dict.Add("wjbt", boacd.wjbt == "" ? "" : boacd.wjbt);//文件标题 dict.Add("zs", boacd.zs == "" ? "" : boacd.zs);//主送 dict.Add("cb", boacd.cb == "" ? "" : boacd.cb);//抄报 dict.Add("cs", boacd.cs == "" ? "" : boacd.cs);//抄送 dict.Add("ztc", boacd.ztc == "" ? "" : boacd.ztc);// 主题词 dict.Add("zbbm", boacd.zbbm == "" ? "" : boacd.zbbm);//主办部门 dict.Add("jd", boacd.jd == "" ? "" : boacd.jd);//校对 dict.Add("dzy", boacd.dzy == "" ? "" : boacd.dzy);// 打字员 dict.Add("bz", boacd.bz == "" ? "" : boacd.bz);//备注 dict.Add("yx", boacd.yx == "" ? "" : boacd.yx);//一校 dict.Add("ex", boacd.ex == "" ? "" : boacd.ex);//二校 string gklx = boacd.gklx;//公开类型 switch (gklx) { case "1": dict.Add("gklx1", "√"); break; case "2": dict.Add("gklx2", "√"); break; case "3": dict.Add("gklx3", "√"); break; } // 打印日期 dict.Add("printTime", DateTime.Now.ToLongDateString()); DataTable dataTable = CommonFunctional.GetUserNameAndDepartNameByActId(caseid, "A002", tran); if (dataTable.Rows.Count > 0) { string name = dataTable.Rows[0][1] + " " + dataTable.Rows[0][0]; dict.Add("ngr", name);// 拟稿人 } //评阅意见的插入 #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> ngbmfzrhgList = new List<B_OA_PrintParagragh>(); List<B_OA_PrintParagragh> hbdwyjList = new List<B_OA_PrintParagragh>(); List<B_OA_PrintParagragh> fgldshList = new List<B_OA_PrintParagragh>(); List<B_OA_PrintParagragh> jbgsfzrhgList = 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") { ngbmfzrhgList.Add(listPara[i]); } //局办公室负责人核稿 else if (listPara[i].ActID == "A004") { jbgsfzrhgList.Add(listPara[i]); } // 分管领导审核 else if (listPara[i].ActID == "A005") { fgldshList.Add(listPara[i]); } //会办单位意见 else if (listPara[i].ActID == "A010") { hbdwyjList.Add(listPara[i]); } //会办单位意见 else if (listPara[i].ActID == "A006") { qfList.Add(listPara[i]); } } int k = 0; //拟稿部门负责人 var imgNgbmfzrhgList = new OpenXmlHelper.ImageTextArray[ngbmfzrhgList.Count]; for (k = 0; k < ngbmfzrhgList.Count; k++) { imgNgbmfzrhgList[k] = new OpenXmlHelper.ImageTextArray(); imgNgbmfzrhgList[k].Images = ngbmfzrhgList[k].Image; imgNgbmfzrhgList[k].Text = ngbmfzrhgList[k].Text; imgNgbmfzrhgList[k].Foots = ngbmfzrhgList[k].Foots; imgNgbmfzrhgList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("ngbmfzrhg", imgNgbmfzrhgList); //局办公室负责人核稿 var imgJbgsfzrhgList = new OpenXmlHelper.ImageTextArray[jbgsfzrhgList.Count]; for (k = 0; k < jbgsfzrhgList.Count; k++) { imgJbgsfzrhgList[k] = new OpenXmlHelper.ImageTextArray(); imgJbgsfzrhgList[k].Images = jbgsfzrhgList[k].Image; imgJbgsfzrhgList[k].Text = jbgsfzrhgList[k].Text; imgJbgsfzrhgList[k].Foots = jbgsfzrhgList[k].Foots; imgJbgsfzrhgList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("jbgsfzrhg", imgJbgsfzrhgList); //分管领导审核 var imgFgldshList = new OpenXmlHelper.ImageTextArray[fgldshList.Count]; for (k = 0; k < fgldshList.Count; k++) { imgFgldshList[k] = new OpenXmlHelper.ImageTextArray(); imgFgldshList[k].Images = fgldshList[k].Image; imgFgldshList[k].Text = fgldshList[k].Text; imgFgldshList[k].Foots = fgldshList[k].Foots; imgFgldshList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("fgldsh", imgFgldshList); //会办单位意见 var imgHbdwyjList = new OpenXmlHelper.ImageTextArray[hbdwyjList.Count]; for (k = 0; k < hbdwyjList.Count; k++) { imgHbdwyjList[k] = new OpenXmlHelper.ImageTextArray(); imgHbdwyjList[k].Images = hbdwyjList[k].Image; imgHbdwyjList[k].Text = hbdwyjList[k].Text; imgHbdwyjList[k].Foots = hbdwyjList[k].Foots; imgHbdwyjList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("hbdwyj", imgHbdwyjList); //签发 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("qf", imgQfList); #endregion //读取签发图片 StringBuilder strSql = new StringBuilder(); strSql.AppendFormat(@" select s.*,u.CnName from B_OA_Sighture as s LEFT JOIN FX_UserInfo as u on s.userid = u.UserID where s.caseid='{0}' and s.tableName='{1}' and s.columnName='{2}' and s.type='{3}'", caseid, "SendDoc", "qf", "0"); DataSet sightureDs = Utility.Database.ExcuteDataSet(strSql.ToString()); string jsonData = JsonConvert.SerializeObject(sightureDs.Tables[0]); List<B_OA_Sighture> listSighture = (List<B_OA_Sighture>)JsonConvert.DeserializeObject(jsonData, typeof(List<B_OA_Sighture>)); if (listSighture.Count > 0) { B_OA_Sighture sighture = new B_OA_Sighture(); sighture = listSighture[0]; string rootPath = HttpContext.Current.Server.MapPath("/"); rootPath = rootPath.Replace("\\", "/"); string path = rootPath + sighture.path; if (File.Exists(path)) { dict.Add("qf", System.Drawing.Image.FromFile(path));//备注 } } return dict; }
private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran) { B_OA_LeaveList leave = new B_OA_LeaveList(); leave.Condition.Add("caseId=" + caseid); leave = Utility.Database.QueryObject<B_OA_LeaveList>(leave, tran); Dictionary<string, Object> dict = new Dictionary<string, Object>(); DeptInfoAndUserInfo dpAndUserInfo = ComClass.GetDeptAndUserByUserId(leave.leaveer); FX_UserInfo_Add userInfor = CommonFunctional.GetUserInfoAddByUserId(leave.leaveer, tran); if (userInfor != null) { //工作年限 dict.Add("wyear", userInfor.WYear == null ? "" : userInfor.WYear); //参加工作时间 if (!string.IsNullOrEmpty(userInfor.inJobDate.ToString())) { string inJobDate = (DateTime.Parse(userInfor.inJobDate.ToString())).ToString("yyyy年MM月dd日"); dict.Add("inJobDate", inJobDate); } dict.Add("vday", userInfor.VDay == null ? "" : userInfor.VDay); } //姓名 dict.Add("name", dpAndUserInfo.userinfo.CnName == null ? "" : dpAndUserInfo.userinfo.CnName); //科室 dict.Add("dpName", dpAndUserInfo.deptinfo.DPName == null ? "" : dpAndUserInfo.deptinfo.DPName); //拟休假天数 dict.Add("totalDays", leave.totalDays.ToString()); //请假事由 dict.Add("leaveReson", leave.leaveReason == null ? "" : leave.leaveReason); //起止日期 string startTime = (DateTime.Parse(leave.leaveStartTime.ToString())).ToString("yyyy年MM月dd日 hh:mm"); string endTime = (DateTime.Parse(leave.leaveEndTime.ToString())).ToString("yyyy年MM月dd日 hh:mm"); dict.Add("startTime", startTime); dict.Add("endTime", endTime); //查找已休假天数 StringBuilder strSql = new StringBuilder(); strSql.AppendFormat(@" select SUM(b1.actualDays) as actualDays from B_OA_LeaveList as b1 LEFT JOIN Para_BizTypeItem as d1 on d1.csz =cast(b1.leaveType as nvarchar)-- b1.leaveType LEFT JOIN Para_BizTypeDictionary as c1 on c1.id = d1.flid where c1.lx = 'leaveType' and b1.leaveer = '{0}' and b1.caseId in (select b.CaseID from FX_WorkFlowCase as a LEFT JOIN FX_WorkFlowBusAct as b on a.ID = b.CaseID where FlowID ='W000079' and ActID = 'A004' GROUP BY b.CaseID) and b1.leaveStartTime >='2015-01-01' and b1.leaveStartTime <='2015-12-31' ", leave.leaveer); DataTable dataDay = Utility.Database.ExcuteDataSet(strSql.ToString(), tran).Tables[0]; if (dataDay.Rows.Count > 0) { dict.Add("haveLeaveDay", dataDay.Rows[0]["actualDays"].ToString()); } //获取所有评阅意见 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> szryjList = new List<B_OA_PrintParagragh>(); //办公室审核 List<B_OA_PrintParagragh> bgsshList = new List<B_OA_PrintParagragh>(); //分管领导意见 List<B_OA_PrintParagragh> fgldyjList = new List<B_OA_PrintParagragh>(); //站长审核 List<B_OA_PrintParagragh> zzshList = new List<B_OA_PrintParagragh>(); int k = 0; //室主任意见 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A002") { szryjList.Add(listPara[k]); } } //室主任意见 var imgSzryjList = new OpenXmlHelper.ImageTextArray[szryjList.Count]; for (k = 0; k < szryjList.Count; k++) { imgSzryjList[k] = new OpenXmlHelper.ImageTextArray(); imgSzryjList[k].Images = szryjList[k].Image; imgSzryjList[k].Text = szryjList[k].Text; imgSzryjList[k].Foots = szryjList[k].Foots; imgSzryjList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("szryj", imgSzryjList); //办公室审核 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A007") { bgsshList.Add(listPara[k]); } } //办公室审核 var imgBgsshList = new OpenXmlHelper.ImageTextArray[szryjList.Count]; for (k = 0; k < szryjList.Count; k++) { imgBgsshList[k] = new OpenXmlHelper.ImageTextArray(); imgBgsshList[k].Images = bgsshList[k].Image; imgBgsshList[k].Text = bgsshList[k].Text; imgBgsshList[k].Foots = bgsshList[k].Foots; imgBgsshList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("bgsh", imgBgsshList); //分管领导意见 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A003") { fgldyjList.Add(listPara[k]); } } //分管领导意见 var imgFgldyjList = new OpenXmlHelper.ImageTextArray[fgldyjList.Count]; for (k = 0; k < fgldyjList.Count; k++) { imgFgldyjList[k] = new OpenXmlHelper.ImageTextArray(); imgFgldyjList[k].Images = fgldyjList[k].Image; imgFgldyjList[k].Text = fgldyjList[k].Text; imgFgldyjList[k].Foots = fgldyjList[k].Foots; imgFgldyjList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("fgldyj", imgFgldyjList); //站长审核 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A008") { zzshList.Add(listPara[k]); } } //站长审核 var imgZzshListList = new OpenXmlHelper.ImageTextArray[zzshList.Count]; for (k = 0; k < zzshList.Count; k++) { imgZzshListList[k] = new OpenXmlHelper.ImageTextArray(); imgZzshListList[k].Images = zzshList[k].Image; imgZzshListList[k].Text = zzshList[k].Text; imgZzshListList[k].Foots = zzshList[k].Foots; imgZzshListList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("zzspyj", imgZzshListList); return dict; }
/// <summary> /// 查找审批意见 /// </summary> /// <param name="caseId"></param> /// <returns></returns> public static GetDataModel GetWorkFlowCaseByCaseId(string caseId, IDbTransaction tran) { GetDataModel dataModel = new GetDataModel(); dataModel.listWork = new List<FX_WorkFlowBusAct>(); dataModel.listSightrue = new List<B_OA_Sighture>(); dataModel.listAttachment = new List<FX_AttachMent>(); FX_WorkFlowBusAct work = new FX_WorkFlowBusAct(); work.Condition.Add("CaseID = " + caseId); StringBuilder strSql = new StringBuilder(); dataModel.listWork = Utility.Database.QueryList<FX_WorkFlowBusAct>(work, tran); //读取签发 strSql.AppendFormat(@"select s.*,u.CnName from B_OA_Sighture as s LEFT JOIN FX_UserInfo as u on s.userid = u.UserID where s.caseid='{0}' and s.columnName = '{1}' and s.type = '{2}'", caseId, "ldps", "0"); DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); dataModel.dataTable = ds.Tables[0]; //B_OA_Sighture sighture = new B_OA_Sighture(); //sighture.Condition.Add("caseid=" + caseId); //sighture.Condition.Add("columnName=" + "ldps"); //sighture.Condition.Add("type=" + "0"); //dataModel.listSightrue = Utility.Database.QueryList<B_OA_Sighture>(sighture, tran); strSql.Clear(); strSql.AppendFormat(@"select * from FX_AttachMent where caseid = '{0}'", caseId); DataSet ds_Attch = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); string jsonData = JsonConvert.SerializeObject(ds_Attch.Tables[0]); List<FX_AttachMent> listAttachment = (List<FX_AttachMent>)JsonConvert.DeserializeObject(jsonData, typeof(List<FX_AttachMent>)); string server = HttpContext.Current.Request.ServerVariables["HTTP_HOST"]; for (int i = 0; i < listAttachment.Count; i++) { listAttachment[i].FilePath = "http://" + server + "//附件目录//" + listAttachment[i].FilePath; } dataModel.listAttachment = listAttachment; // strSql.Clear(); // strSql.AppendFormat(@" // select // b.ID,b.Name,b.FlowName,b.CreaterCnName,CONVERT(VARCHAR(20),b.CreateDate,120) as CreateDate // from B_OA_Supervision as a // LEFT JOIN FX_WorkFlowCase as b // on a.caseid = b.id // where a.relationCaseId = '{0}' // ", caseId); // DataSet ds_WorkFlowCase = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); // string jsonData_WorkFlow = JsonConvert.SerializeObject(ds_WorkFlowCase.Tables[0]); // List<FX_WorkFlowCase> listWorkFlow = (List<FX_WorkFlowCase>)JsonConvert.DeserializeObject(jsonData_WorkFlow, typeof(List<FX_WorkFlowCase>)); // dataModel.listSupervision = listWorkFlow; return dataModel;//将对象转为json字符串并返回到客户端 }
public string GetWorkFlowCaseByCaseId(string caseId) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); GetDataModel dataModel = new GetDataModel(); StringBuilder strSql = new StringBuilder(); try { FX_WorkFlowBusAct work = new FX_WorkFlowBusAct(); work.Condition.Add("CaseID = " + caseId); dataModel.listWork = Utility.Database.QueryList<FX_WorkFlowBusAct>(work, tran); //读取签发 strSql.AppendFormat(@"select s.*,u.CnName from B_OA_Sighture as s LEFT JOIN FX_UserInfo as u on s.userid = u.UserID where s.caseid='{0}' and s.columnName = '{1}' and s.type = '{2}'", caseId, "qf", "0"); DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); dataModel.listSightrue = ds.Tables[0]; dataModel.listSupervision = GetSupervisionList(caseId, tran); Utility.Database.Commit(tran); return Utility.JsonResult(true, "数据加载成功", dataModel);//将对象转为json字符串并返回到客户端 } catch (Exception ex) { ComBase.Logger(ex); return Utility.JsonResult(false, ex.Message); } }
private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran) { B_OA_ReceiveDoc_QuZhan receiveDoc = new B_OA_ReceiveDoc_QuZhan(); receiveDoc.Condition.Add("caseid=" + caseid); receiveDoc = Utility.Database.QueryObject<B_OA_ReceiveDoc_QuZhan>(receiveDoc, tran); Dictionary<string, Object> dict = new Dictionary<string, Object>(); dict.Add("code", receiveDoc.code == null ? "" : receiveDoc.code);//编号 dict.Add("lwdw", receiveDoc.lwdw == null ? "" : receiveDoc.lwdw);//来文单位 dict.Add("wjmc", receiveDoc.wjmc == null ? "" : receiveDoc.wjmc);//文件名称 dict.Add("bgsnbyj", receiveDoc.toDoSug == null ? "" : receiveDoc.toDoSug);//文件名称 dict.Add("remark", receiveDoc.remark == null ? "" : receiveDoc.remark);//备注 if (!string.IsNullOrEmpty(receiveDoc.lwrq.ToString())) { string createDate = (DateTime.Parse(receiveDoc.lwrq.ToString())).ToString("yyyy年MM月dd日"); dict.Add("createDate", createDate);//主送 } if (!string.IsNullOrEmpty(receiveDoc.zbsj.ToString())) { string zbsj = (DateTime.Parse(receiveDoc.zbsj.ToString())).ToString("yyyy年MM月dd日"); dict.Add("zbsj", zbsj);//主送 } //获取所有评阅意见 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> ldpsList = new List<B_OA_PrintParagragh>(); int k = 0; //领导批示 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A005") { ldpsList.Add(listPara[k]); } } //承办科室负责人 var imgLdpsList = new OpenXmlHelper.ImageTextArray[ldpsList.Count]; for (k = 0; k < ldpsList.Count; k++) { imgLdpsList[k] = new OpenXmlHelper.ImageTextArray(); imgLdpsList[k].Images = ldpsList[k].Image; imgLdpsList[k].Text = ldpsList[k].Text; imgLdpsList[k].Foots = ldpsList[k].Foots; imgLdpsList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("ldps", imgLdpsList); return dict; }
/// <summary> /// 获取业务当前节点Id(actid) /// </summary> /// <param name="caseid"></param> /// <returns></returns> public static FX_WorkFlowBusAct GetCurrentActId(string caseid) { FX_WorkFlowBusAct busact = new FX_WorkFlowBusAct(); busact.Condition.Add("CaseID = " + caseid); busact.OrderInfo = "ReceDate DESC"; busact = Utility.Database.QueryObject<FX_WorkFlowBusAct>(busact); return busact; }
/// <summary> /// 创建一个Word数据 /// </summary> /// <param name="caseid"></param> /// <returns></returns> private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran) { B_OA_SendDoc_QuZhan boacd = new B_OA_SendDoc_QuZhan(); boacd.Condition.Add("caseid = " + caseid);//设置查询条件 boacd = Utility.Database.QueryObject<B_OA_SendDoc_QuZhan>(boacd, tran); FX_WorkFlowBusAct wfba = new FX_WorkFlowBusAct(); wfba.Condition.Add("CaseID = " + caseid);//设置查询条件 List<FX_WorkFlowBusAct> wfbaList = Utility.Database.QueryList(wfba); Dictionary<string, Object> dict = new Dictionary<string, Object>(); dict.Add("title", boacd.title == null ? "" : boacd.title);//标题 dict.Add("printCount", boacd.printCount == null ? "" : boacd.printCount);//页数 dict.Add("zs", boacd.zs == null ? "" : boacd.zs);//主送 dict.Add("cs", boacd.cs == null ? "" : boacd.cs);//抄送 dict.Add("cb", boacd.cb == null ? "" : boacd.cb);//抄报 if (boacd.sendCheckType == "1") { dict.Add("ghz", boacd.guiHuanZhan == null ? "" : boacd.guiHuanZhan);//桂环站 dict.Add("c_ghz", "☑");//桂环站 dict.Add("c_dtnw", "☐");//代厅拟文 dict.Add("c_nbsx", "☐");//内部事项 dict.Add("c_qt", "☐");//其他 } else if (boacd.sendCheckType == "2") { dict.Add("dtnw", boacd.daiTingNiWen == null ? "" : boacd.daiTingNiWen);//代厅拟文 dict.Add("c_ghz", "☐");//桂环站 dict.Add("c_dtnw", "☑");//代厅拟文 dict.Add("c_nbsx", "☐");//内部事项 dict.Add("c_qt", "☐");//其他 } else if (boacd.sendCheckType == "3") { dict.Add("nbsx", boacd.neiBuShiXiang == null ? "" : boacd.neiBuShiXiang);//代厅拟文 dict.Add("c_ghz", "☐");//桂环站 dict.Add("c_dtnw", "☐");//代厅拟文 dict.Add("c_nbsx", "☑");//内部事项 dict.Add("c_qt", "☐");//其他 } else if (boacd.sendCheckType == "4") { dict.Add("qt", boacd.qiTa == null ? "" : boacd.qiTa);//代厅拟文 dict.Add("c_ghz", "☐");//桂环站 dict.Add("c_dtnw", "☐");//代厅拟文 dict.Add("c_nbsx", "☐");//内部事项 dict.Add("c_qt", "☑");//其他 } //密级 DataTable mjTable = CommonFunctional.GetParamItem("mjTypeDic", boacd.mj, tran); if (mjTable != null) { dict.Add("mj", mjTable.Rows[0]["mc"]);//密级 } //紧急 DataTable emergencyTable = CommonFunctional.GetParamItem("emergencyLevelDic", boacd.mj, tran); if (emergencyTable != null) { dict.Add("emergency", emergencyTable.Rows[0]["mc"]);//密级 } //获取所有评阅意见 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> cbksfzrList = new List<B_OA_PrintParagragh>(); //办公室核稿意见 List<B_OA_PrintParagragh> bgshgyjList = new List<B_OA_PrintParagragh>(); //校对人 List<B_OA_PrintParagragh> jdrList = new List<B_OA_PrintParagragh>(); //承办科室拟稿人 List<B_OA_PrintParagragh> cbksngrList = new List<B_OA_PrintParagragh>(); //承办科室拟稿人 List<B_OA_PrintParagragh> qfList = new List<B_OA_PrintParagragh>(); int k = 0; //承办科室负责人 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A002") { cbksfzrList.Add(listPara[k]); } } //办公室核稿意见 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A003" || listPara[k].ActID == "A004") { bgshgyjList.Add(listPara[k]); } } //校对人 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A009") { jdrList.Add(listPara[k]); } } //承办科室拟稿人 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A001") { cbksngrList.Add(listPara[k]); } } //签发 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A005" || listPara[k].ActID == "A007") { qfList.Add(listPara[k]); } } //承办科室负责人 var imgCbksfzrList = new OpenXmlHelper.ImageTextArray[cbksfzrList.Count]; for (k = 0; k < cbksfzrList.Count; k++) { imgCbksfzrList[k] = new OpenXmlHelper.ImageTextArray(); imgCbksfzrList[k].Images = cbksfzrList[k].Image; imgCbksfzrList[k].Text = cbksfzrList[k].Text; imgCbksfzrList[k].Foots = cbksfzrList[k].Foots; imgCbksfzrList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("cbksfzr", imgCbksfzrList); //办公室核稿意见 var imgBgshgyjList = new OpenXmlHelper.ImageTextArray[bgshgyjList.Count]; for (k = 0; k < bgshgyjList.Count; k++) { imgBgshgyjList[k] = new OpenXmlHelper.ImageTextArray(); imgBgshgyjList[k].Images = bgshgyjList[k].Image; imgBgshgyjList[k].Text = bgshgyjList[k].Text; imgBgshgyjList[k].Foots = bgshgyjList[k].Foots; imgBgshgyjList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("bgshgyj", imgBgshgyjList); //校对人 var imgJdrList = new OpenXmlHelper.ImageTextArray[jdrList.Count]; for (k = 0; k < jdrList.Count; k++) { imgJdrList[k] = new OpenXmlHelper.ImageTextArray(); imgJdrList[k].Images = jdrList[k].Image; imgJdrList[k].Text = jdrList[k].Text; imgJdrList[k].Foots = jdrList[k].Foots; imgJdrList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("jdr", imgJdrList); //承办科室拟稿人 var imgCbksngrList = new OpenXmlHelper.ImageTextArray[cbksngrList.Count]; for (k = 0; k < cbksngrList.Count; k++) { imgCbksngrList[k] = new OpenXmlHelper.ImageTextArray(); imgCbksngrList[k].Images = cbksngrList[k].Image; imgCbksngrList[k].Text = cbksngrList[k].Text; imgCbksngrList[k].Foots = cbksngrList[k].Foots; imgCbksngrList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("cbksngr", imgCbksngrList); //签发 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("qf", imgQfList); return dict; }
/// <summary> /// 创建一个Word数据 /// </summary> /// <param name="caseid"></param> /// <returns></returns> private Dictionary<string, Object> CreateWrodData(string caseid, IDbTransaction tran) { B_OA_ReceiveDoc en = new B_OA_ReceiveDoc(); en.Condition.Add("caseid = " + caseid);//设置查询条件 en = Utility.Database.QueryObject<B_OA_ReceiveDoc>(en); Dictionary<string, Object> list = new Dictionary<string, Object> { {"lwsj",en.swrq.ToString() },//收文日期 {"lwdw",en.lwdw},//来文单位 {"wjbt",en.wjbt},//文件标题 {"nbyj",en.nbyj},//拟办意见 {"jbgs",en.jbgs},//局办公室 {"lwyq",en.lwyq}, //来文要求 {"lwbh",en.lwbh}, //来问编号 }; List<B_OA_PrintParagragh> listPara = new List<B_OA_PrintParagragh>(); List<B_OA_PrintParagragh> listPara_Ldps = new List<B_OA_PrintParagragh>(); //获取所有评阅意见 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); //将所有工作流信息格式化 listPara = CommonFunctional.ChangeListToMatch(listWork); //领导批示 for (int i = 0; i < listPara.Count;i++ ) { if (listPara[i].ActID == "A004" || listPara[i].ActID == "A003") { if (listPara[i].Image != null || listPara[i].Text != null) { listPara_Ldps.Add(listPara[i]); } } } var imgLdps = new OpenXmlHelper.ImageTextArray[listPara_Ldps.Count]; for (int k = 0; k < listPara_Ldps.Count; k++) { imgLdps[k] = new OpenXmlHelper.ImageTextArray(); imgLdps[k].Images = listPara_Ldps[k].Image; imgLdps[k].Text = listPara_Ldps[k].Text; imgLdps[k].Foots = listPara_Ldps[k].Foots; imgLdps[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } list.Add("ldps", imgLdps); return list; }
public string GetWorkFlowCaseByCaseId(string caseId) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); GetDataModel dataModel = new GetDataModel(); dataModel.listWork = new List<FX_WorkFlowBusAct>(); dataModel.listSightrue = new List<B_OA_Sighture>(); dataModel.listAttachment = new List<FX_AttachMent>(); try { FX_WorkFlowBusAct work = new FX_WorkFlowBusAct(); work.Condition.Add("CaseID = " + caseId); StringBuilder strSql = new StringBuilder(); dataModel.listWork = Utility.Database.QueryList<FX_WorkFlowBusAct>(work, tran); //读取手写签名 strSql.AppendFormat(@"select s.*,u.CnName from B_OA_Sighture as s LEFT JOIN FX_UserInfo as u on s.userid = u.UserID where s.caseid='{0}' and s.columnName = '{1}' and s.type = '{2}'", caseId, "ldps", "0"); DataSet ds = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); dataModel.dataTable = ds.Tables[0]; //B_OA_Sighture sighture = new B_OA_Sighture(); //sighture.Condition.Add("caseid=" + caseId); //sighture.Condition.Add("columnName=" + "ldps"); //sighture.Condition.Add("type=" + "0"); //dataModel.listSightrue = Utility.Database.QueryList<B_OA_Sighture>(sighture, tran); strSql.Clear(); strSql.AppendFormat(@"select * from FX_AttachMent where caseid = '{0}'", caseId); DataSet ds_Attch = Utility.Database.ExcuteDataSet(strSql.ToString(), tran); string jsonData = JsonConvert.SerializeObject(ds_Attch.Tables[0]); List<FX_AttachMent> listAttachment = (List<FX_AttachMent>)JsonConvert.DeserializeObject(jsonData, typeof(List<FX_AttachMent>)); string server = HttpContext.Current.Request.ServerVariables["HTTP_HOST"]; for (int i = 0; i < listAttachment.Count; i++) { listAttachment[i].FilePath = "http://" + server + "//附件目录//" + listAttachment[i].FilePath; } dataModel.listSupervision = GetSupervisionList(caseId, tran); //发文关联 Utility.Database.Commit(tran); return Utility.JsonResult(true, "数据加载成功", dataModel);//将对象转为json字符串并返回到客户端 } catch (Exception ex) { ComBase.Logger(ex); return Utility.JsonResult(false, ex.Message); } }
/// <summary> /// 创建一个Word数据 /// </summary> /// <param name="caseid"></param> /// <returns></returns> private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran) { B_OA_Meeting data = GetMeetingByCaseId(caseid, tran); Dictionary<string, Object> dict = new Dictionary<string, Object>(); //申请科室 dict.Add("Dpname", data.Dpname); //会议名称 dict.Add("MeetingName", data.MeetingName == null ? "" : data.MeetingName); //内容 dict.Add("Purpose", data.Purpose == null ? "" : data.Purpose); //会议时间 if (!string.IsNullOrEmpty(data.StartTime.ToString())) { string StartTime = (DateTime.Parse(data.StartTime.ToString())).ToString("yyyy年MM月dd日 hh时"); dict.Add("StartTime", StartTime);//主送 } if (!string.IsNullOrEmpty(data.StartTime.ToString())) { string EndTime = (DateTime.Parse(data.EndTime.ToString())).ToString("yyyy年MM月dd日 hh时"); dict.Add("EndTime", EndTime);//主送 } //会议地点 dict.Add("meetingRoomName", data.MeetingRoomName == null ? "" : data.MeetingRoomName); //参会人员 dict.Add("ParticipantNames", data.ParticipantNames == null ? "" : data.ParticipantNames); //参会人数 dict.Add("Number", data.Number.ToString() == null ? "" : data.Number.ToString()); //参会人数 dict.Add("OrganizerName", data.OrganizerName == null ? "" : data.OrganizerName); //获取所有评阅意见 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> officeSugList = new List<B_OA_PrintParagragh>(); int k = 0; //承办科室负责人意见 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A002") { officeSugList.Add(listPara[k]); } } //办公室核稿意见 var imgOfficeSugListList = new OpenXmlHelper.ImageTextArray[officeSugList.Count]; for (k = 0; k < officeSugList.Count; k++) { imgOfficeSugListList[k] = new OpenXmlHelper.ImageTextArray(); imgOfficeSugListList[k].Images = officeSugList[k].Image; imgOfficeSugListList[k].Text = officeSugList[k].Text; imgOfficeSugListList[k].Foots = officeSugList[k].Foots; imgOfficeSugListList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("officeSug", imgOfficeSugListList); return dict; }
/// <summary> /// 创建一个Word数据 /// </summary> /// <param name="caseid"></param> /// <returns></returns> private Dictionary<string, Object> CreateWordSendDocData(string caseid, IDbTransaction tran) { //创建内容 Dictionary<string, Object> dict = new Dictionary<string, Object>(); B_OA_TravelList en = new B_OA_TravelList(); en.Condition.Add("caseId=" + caseid); en = Utility.Database.QueryObject<B_OA_TravelList>(en); DeptInfoAndUserInfo d_u_Infor = ComClass.GetDeptAndUserByUserId(en.traveler); en.travelerName = d_u_Infor.userinfo.CnName; en.dpname = d_u_Infor.deptinfo.DPName; dict.Add("travelDps", en.travelDps == null ? "" : en.travelDps); dict.Add("travelAddress", en.travelAddress == null ? "" : en.travelAddress); dict.Add("travelReason", en.travelReason == null ? "" : en.travelReason); dict.Add("carStatus", en.carStatus == null ? "" : en.carStatus); dict.Add("remark", en.remark == null ? "" : en.remark); if (!string.IsNullOrEmpty(en.ortherMan)) { en.travelNames = en.travelNames + en.ortherMan; } dict.Add("travelNames", en.travelNames == null ? "" : en.travelNames); string startTime = ""; if (!string.IsNullOrEmpty(en.travelStartTime.ToString())) { startTime = (DateTime.Parse(en.travelStartTime.ToString())).ToString("yyyy年MM月dd日 hh:mm"); } string endTime = ""; if (!string.IsNullOrEmpty(en.travelEndTime.ToString())) { endTime = (DateTime.Parse(en.travelEndTime.ToString())).ToString("yyyy年MM月dd日 hh:mm"); } dict.Add("travelStartTime", startTime); dict.Add("travelEndTime", endTime); //获取所有评阅意见 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> szrSugList = new List<B_OA_PrintParagragh>(); //站领导意见 List<B_OA_PrintParagragh> zldSugList = new List<B_OA_PrintParagragh>(); int k = 0; //室主任意见 for (k = 0; k < listPara.Count; k++) { if (listPara[k].ActID == "A002") { szrSugList.Add(listPara[k]); } else if (listPara[k].ActID == "A003") { zldSugList.Add(listPara[k]); } } //室主任意见 var imgSzrSugList = new OpenXmlHelper.ImageTextArray[szrSugList.Count]; for (k = 0; k < szrSugList.Count; k++) { imgSzrSugList[k] = new OpenXmlHelper.ImageTextArray(); imgSzrSugList[k].Images = szrSugList[k].Image; imgSzrSugList[k].Text = szrSugList[k].Text; imgSzrSugList[k].Foots = szrSugList[k].Foots; imgSzrSugList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("szrSug", imgSzrSugList); //站领导意见 var imgZldSugList = new OpenXmlHelper.ImageTextArray[zldSugList.Count]; for (k = 0; k < zldSugList.Count; k++) { imgZldSugList[k] = new OpenXmlHelper.ImageTextArray(); imgZldSugList[k].Images = zldSugList[k].Image; imgZldSugList[k].Text = zldSugList[k].Text; imgZldSugList[k].Foots = zldSugList[k].Foots; imgZldSugList[k].FootAlign = DocumentFormat.OpenXml.Wordprocessing.JustificationValues.Right; } dict.Add("zldSug", imgZldSugList); return dict; }