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(); B_OA_LeaveList en = new B_OA_LeaveList(); en.Condition.Add("caseId=" + caseId); data.baseInfo = Utility.Database.QueryObject<B_OA_LeaveList>(en); if (data.baseInfo == null) { data.baseInfo = new B_OA_LeaveList(); DeptInfoAndUserInfo d_u_Infor = ComClass.GetDeptAndUserByUserId(userid); data.baseInfo.leaveer = userid; data.baseInfo.leaveName = d_u_Infor.userinfo.CnName; data.baseInfo.dpname = d_u_Infor.deptinfo.DPName; } else { data.baseInfo.leaveName = ComClass.GetUserInfo(data.baseInfo.leaveer).CnName; data.baseInfo.dpname = ComClass.GetDeptByUserId(data.baseInfo.leaveer).FullName; } return data; } catch (Exception ex) { ComBase.Logger(ex); throw (new Exception("获取数据失败!", ex)); } }
public object DeleteData(string caseId, string userid) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); try { //审核记录表 if (!string.IsNullOrEmpty(caseId)) { B_OA_LeaveList car = new B_OA_LeaveList(); car.Condition.Add("caseId=" + caseId); Utility.Database.Delete(car, tran); engineAPI.Delete(caseId, userid, tran); Utility.Database.Commit(tran); } else { throw (new Exception("删除数据失败")); } bool b = true; return new { b = b }; } catch (Exception ex) { Utility.Database.Rollback(tran); ComBase.Logger(ex); throw (new Exception("删除失败!", ex)); } }
public object DeleteData(string caseId, string userid) { IDbTransaction tran = Utility.Database.BeginDbTransaction(); try { //审核记录表 if (!string.IsNullOrEmpty(caseId)) { string priName = CommonFunctional.JudgeMan(userid, tran); if (priName == "all") { //全局权限 可删除所有数据 DeleteData(caseId, userid, tran); } else if (priName == "dep") { //若有部门权限 可删除本部门的数据 B_OA_LeaveList leave = new B_OA_LeaveList(); leave.Condition.Add("caseId=" + caseId); leave = Utility.Database.QueryObject(leave, tran); string leaveDpId = ComClass.GetUserInfo(leave.leaveer).DPID; string uDpId = ComClass.GetUserInfo(userid).DPID; if (leaveDpId == uDpId) { DeleteData(caseId, userid, tran); } else { throw (new Exception("您只能删除本部门的数据,无权删除此数据!")); } } else { throw (new Exception("您没有权限删除此业务!")); } } else { throw (new Exception("删除数据失败")); } bool b = true; Utility.Database.Commit(tran); return new { b = b }; } catch (Exception ex) { Utility.Database.Rollback(tran); ComBase.Logger(ex); throw (new Exception("删除失败!", ex)); } }
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; }
public object GetLeaveByCaseId(string caseid) { var tran = Utility.Database.BeginDbTransaction(); try { B_OA_LeaveList baseInfor = new B_OA_LeaveList(); baseInfor.Condition.Add("caseId = " + caseid); baseInfor = Utility.Database.QueryObject<B_OA_LeaveList>(baseInfor); baseInfor.leaveName = ComClass.GetUserInfo(baseInfor.leaveer).CnName; baseInfor.dpname = ComClass.GetDeptByUserId(baseInfor.leaveer).FullName; Utility.Database.Commit(tran); return new { baseInfor = baseInfor }; } catch (Exception ex) { Utility.Database.Rollback(tran); ComBase.Logger(ex); throw (new Exception("打印失败!", ex)); } }
public bool DeleteCase(string caseid, string userid, Object obj) { IDbTransaction tran = (IDbTransaction)obj; //加入针对不同的业务的删除前处理 FX_WorkFlowCase workFlow = new FX_WorkFlowCase(); workFlow.Condition.Add("ID =" + caseid); workFlow = Utility.Database.QueryObject<FX_WorkFlowCase>(workFlow, tran); if (workFlow != null) { string flowId = workFlow.FlowID; switch (flowId) { case "W000098": //发文 B_OA_SendDoc_QuZhan sendDoc = new B_OA_SendDoc_QuZhan(); sendDoc.Condition.Add("caseid=" + caseid); Utility.Database.Delete(sendDoc, tran); break; case "W000099": //收文 B_OA_ReceiveDoc_QuZhan receiveDoc = new B_OA_ReceiveDoc_QuZhan(); receiveDoc.Condition.Add("caseid=" + caseid); Utility.Database.Delete(receiveDoc, tran); break; case "W000100": //内部事项 B_OA_SendDoc_Inner_QuZhan innderDoc = new B_OA_SendDoc_Inner_QuZhan(); innderDoc.Condition.Add("caseId=" + caseid); Utility.Database.Delete(innderDoc, tran); break; case "W000070": //车辆申请 B_OA_Car car = new B_OA_Car(); car.Condition.Add("workflowcaseid=" + caseid); Utility.Database.Delete(car, tran); break; case "W000071": //会议申请 B_OA_Meeting data = new B_OA_Meeting(); data.Condition.Add("CaseID=" + caseid); Utility.Database.Delete(data, tran); break; case "W000079": //请假申请 B_OA_LeaveList leave = new B_OA_LeaveList(); leave.Condition.Add("caseId=" + caseid); Utility.Database.Delete(leave, tran); break; case "W000080": //出差申请 B_OA_TravelList travel = new B_OA_TravelList(); travel.Condition.Add("caseId=" + caseid); Utility.Database.Delete(travel, tran); break; case "W000089": //通知公告 B_OA_Notice notice = new B_OA_Notice(); notice.Condition.Add("caseid=" + caseid); Utility.Database.Delete(notice, tran); break; } if (!string.IsNullOrEmpty(caseid)) { //删除正文路径 B_Common_CreateDoc createDoc = new B_Common_CreateDoc(); createDoc.Condition.Add("caseid=" + caseid); Utility.Database.Delete(createDoc, tran); //删除附件 FX_AttachMent attach = new FX_AttachMent(); attach.Condition.Add("CaseID="+caseid); Utility.Database.Delete(attach, tran); } } return true; }