/// <summary> /// 转换成字符串 /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}{1}", BillID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BusinessID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BillType.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrBillType, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BillStatus.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrBillStatus, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BillMonth, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BeginTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", EndTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LimitTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); if (FullPaidTime.HasValue) { sb.AppendFormat("{0}{1}", FullPaidTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } sb.AppendFormat("{0}{1}", IsCurrent.ToString(), WebServiceConst.Separater_1); sb.Append(IsShelve.ToString()); return(sb.ToString()); }
/// <summary> /// 转换成字符串 /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}{1}", AdaptationCardID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BusinessID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", AdaName, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CardUser, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", AdaBankName, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CardNo, WebServiceConst.Separater_1); if (ValidEndTime.HasValue) { sb.AppendFormat("{0}{1}", ValidEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } sb.AppendFormat("{0}{1}", StrValidEndTime, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ValidName, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ValidPath, WebServiceConst.Separater_1); sb.Append(AdaDesc); return(sb.ToString()); }
/// <summary> /// 业务处理,更新Monthlyreport表ProcessOwn字段,添加actio表记录 /// </summary> public void DisposeBusinessData() { #region 业务处理 if (string.IsNullOrEmpty(this.BusinessID)) { throw new Exception("BusinessID is null!"); } else { //添加谁点击了提交审批按钮 B_MonthlyReport ReportModel = null; B_SystemBatch _BatchModel = null; //正常的月报ID if (string.IsNullOrEmpty(ProType)) { ReportModel = B_MonthlyreportOperator.Instance.GetMonthlyreport(BusinessID.ToGuid()); //月报业务ID ,没有问题 if (string.IsNullOrEmpty(ReportModel.ProcessOwn)) { ReportModel.ProcessOwn = this.CurrentUser; B_MonthlyreportOperator.Instance.UpdateMonthlyreport(ReportModel); } B_MonthlyReportAction _bMonthlyReportAction = new B_MonthlyReportAction(); _bMonthlyReportAction.SystemID = ReportModel.SystemID; _bMonthlyReportAction.MonthlyReportID = ReportModel.ID; _bMonthlyReportAction.FinYear = ReportModel.FinYear; _bMonthlyReportAction.FinMonth = ReportModel.FinMonth; _bMonthlyReportAction.Action = EnumHelper.GetEnumDescription(typeof(MonthlyReportLogActionType), (int)MonthlyReportLogActionType.Submit); _bMonthlyReportAction.Operator = this.CurrentUser; _bMonthlyReportAction.OperatorTime = DateTime.Now; _bMonthlyReportAction.ModifierName = this.CurrentUser; _bMonthlyReportAction.CreatorName = this.CurrentUser; B_MonthlyReportActionOperator.Instance.AddMonthlyReportAction(_bMonthlyReportAction); } else { //批次ID获取实体 _BatchModel = B_SystemBatchOperator.Instance.GetSystemBatch(BusinessID.ToGuid()); _BatchModel.ModifierName = this.CurrentUser; B_SystemBatchOperator.Instance.UpdateSystemBatch(_BatchModel); B_MonthlyReportAction _bMonthlyReportAction = new B_MonthlyReportAction(); _bMonthlyReportAction.SystemID = Guid.Empty; _bMonthlyReportAction.MonthlyReportID = _BatchModel.ID; _bMonthlyReportAction.FinYear = _BatchModel.FinYear; _bMonthlyReportAction.FinMonth = _BatchModel.FinMonth; _bMonthlyReportAction.Action = EnumHelper.GetEnumDescription(typeof(MonthlyReportLogActionType), (int)MonthlyReportLogActionType.Submit); _bMonthlyReportAction.Operator = this.CurrentUser; _bMonthlyReportAction.OperatorTime = DateTime.Now; _bMonthlyReportAction.ModifierName = this.CurrentUser; _bMonthlyReportAction.CreatorName = this.CurrentUser; B_MonthlyReportActionOperator.Instance.AddMonthlyReportAction(_bMonthlyReportAction); } } #endregion }
/// <summary> /// 转换成字符串 /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}{1}", BusinessID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Subject.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Amount.ToString(), WebServiceConst.Separater_1); sb.Append(ReceivedType.ToString()); return(sb.ToString()); }
public void OnProcessExecute(string strPrcessStatus, int OperatorType) { B_TargetPlan rpt = B_TargetplanOperator.Instance.GetTargetPlanByID(BusinessID.ToGuid()); ExceptionHelper.TrueThrow(rpt == null, string.Format("cannot find the report data which id={0}", BusinessID)); WfOperationInfo op = JsonHelper.Deserialize <WfOperationInfo>(OperaionInfo); //有效流程状态:Progress, Approved //6-return, 7 -withdraw if (OperatorType == 6 || OperatorType == 7) { if (OperatorType == 6) { //rpt.WFStatus = "Draft"; rpt.WFStatus = "Progress"; //退回状态仍是审批中 new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Submit, rpt.SystemID, rpt.FinYear, 0, BusinessID.ToGuid()); } else if (OperatorType == 7) { new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Submit, rpt.SystemID, rpt.FinYear, 0, BusinessID.ToGuid()); // rpt.WFStatus = "Draft"; rpt.WFStatus = "Progress"; //退回状态仍是审批中 } } else if (OperatorType == 9)//9, cancel { rpt.WFStatus = "Cancel"; new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Submit, rpt.SystemID, rpt.FinYear, 0, BusinessID.ToGuid()); } else { if (rpt.WFStatus != "Approved") //这里为了避免通知节点的提交覆盖了审批完成状态,而添加的 { rpt.WFStatus = "Progress"; //CreatTime取流程提交时间,该时间为流程开始时间 rpt.CreateTime = DateTime.Now; rpt.Status = 5; } //保存分解指标上报操作状态 new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Submit, rpt.SystemID, rpt.FinYear, 0, BusinessID.ToGuid()); } B_TargetplanOperator.Instance.UpdateTargetplan(rpt); //BPF.Workflow.Object.WorkflowContext wc= BPF.Workflow.Client.WFClientSDK.GetProcess(null,rpt.ID.ToString(), UserLonginID); //if (wc.ProcessInstance.Status == 3) { // OnProecssCompleted(); //} }
/// <summary> /// 转换成字符串 /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}{1}", PenaltyIntID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BusinessID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ReasonID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ReasonItemID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ToBillID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Amount.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", IsShelve.ToString(), WebServiceConst.Separater_1); sb.Append(CreateTime.ToString("yyyy-MM-dd HH:mm:ss")); return sb.ToString(); }
/// <summary> /// 处理流程按钮事件 /// </summary> /// <param name="UserLonginID"></param> public void ExecutionBusinessData(string UserLonginID = null) { switch (this.ExecType) { case "saveApplicationData": //SaveApplactionBusinessData(); break; case "afterAction": ProcessExecuteBusinessData(); AfterExcuteBusinessData(UserLonginID); if (string.IsNullOrEmpty(ProType)) { B_MonthlyReport ReportModelA = B_MonthlyreportOperator.Instance.GetMonthlyreport(BusinessID.ToGuid()); List <NavigatActivity1> lstna = GetProcessIntance(ReportModelA.ID.ToString(), new UserInfo { UserLoginID = this.CurrentUser }); string Json = Newtonsoft.Json.JsonConvert.SerializeObject(lstna); if (ReportModelA.WFStatus == "Draft" && OperatorType == 7) { ReportModelA.ReportApprove = null; } else { ReportModelA.ReportApprove = Json; } B_MonthlyreportOperator.Instance.UpdateMonthlyreport(ReportModelA); } else { var BacthModel = B_SystemBatchOperator.Instance.GetSystemBatch(BusinessID.ToGuid()); List <NavigatActivity1> lstna = GetProcessIntance(BacthModel.ID.ToString(), new UserInfo { UserLoginID = this.CurrentUser }); string Json = Newtonsoft.Json.JsonConvert.SerializeObject(lstna); BacthModel.ReportApprove = Json; B_SystemBatchOperator.Instance.UpdateSystemBatch(BacthModel); } break; case "beforeAction": //BeforeExcuteBusinessData(); break; } }
/// <summary> /// 更新B_MonthlyReport表WFStatus字段。添加审批记录 /// </summary> /// <param name="strPrcessStatus"></param> /// <param name="OperatorType"></param> public void OnProcessExecuteBusinessData(string strPrcessStatus, int OperatorType) { //流程状态,0:未运行,草稿,1:运行中,2:退回,3:审批完成,4:归档,-1:作废,-2:驳回后归档 B_MonthlyReport rpt = B_MonthlyreportOperator.Instance.GetMonthlyreport(BusinessID.ToGuid()); ExceptionHelper.TrueThrow(rpt == null, string.Format("cannot find the report data which id={0}", BusinessID)); //有效流程状态:Progress, Approved //4-return, 9 -withdraw if (OperatorType == 6 || OperatorType == 7) { if (OperatorType == 6) { // rpt.WFStatus = "Draft"; rpt.WFStatus = "Progress"; new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Return, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); } else if (OperatorType == 7) { new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Withdraw, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); //rpt.WFStatus = "Draft"; rpt.WFStatus = "Progress"; } } else if (OperatorType == 9)//9, cancel { rpt.WFStatus = "Cancel"; new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Cancel, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); } else { if (rpt.WFStatus != "Approved") //这里为了避免通知节点的提交覆盖了审批完成状态,而添加的 { rpt.WFStatus = "Progress"; //CreatTime取流程提交时间,该时间为流程开始时间 rpt.CreateTime = DateTime.Now; rpt.Status = 5; } //保存月度经营上报操作状态 new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Submit, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); } B_MonthlyreportOperator.Instance.UpdateMonthlyreport(rpt); //RegistEvent(); }
/// <summary> /// 转换成字符串 /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}{1}", BillItemID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BillID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Subject.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrSubject, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", SubjectType.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Amount.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", DueAmt.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ReceivedAmt.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", PenaltyIntAmt.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); if (FullPaidTime.HasValue) { sb.AppendFormat("{0}{1}", FullPaidTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } sb.AppendFormat("{0}{1}", OperatorID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", IsCurrent.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", IsShelve.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BusinessID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrAmount, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrDueAmt, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrReceivedAmt, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrReceived, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrReceivable, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Display, WebServiceConst.Separater_1); sb.Append(StrCreateTime); return(sb.ToString()); }
/// <summary> /// 转换成字符串 /// </summary> /// <returns></returns> public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0}{1}", BusinessID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CustomerID.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CustomerName, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", IdentityNo, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ProductType.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LoanCapital.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LoanPeriod.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LoanTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BusinessStatus.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrBusinessStatus, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CLoanStatus.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrCLoanStatus, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LawsuitStatus.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", StrLawsuitStatus, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ContractNo, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", SavingCard, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", SavingUser, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LendingSideKey, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LendingSideID, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ServiceSideKey, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ServiceSideID, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", GuaranteeSideKey, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", GuaranteeSideID, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", OverAmount.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CurrentOverAmount.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", OtherAmount.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LoanKind, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LoanKindName, WebServiceConst.Separater_1); if (ToGuaranteeTime.HasValue) { sb.AppendFormat("{0}{1}", ToGuaranteeTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } if (ToLitigationTime.HasValue) { sb.AppendFormat("{0}{1}", ToLitigationTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } if (ClearLoanTime.HasValue) { sb.AppendFormat("{0}{1}", ClearLoanTime.Value.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); } else { sb.AppendFormat("{0}{1}", "", WebServiceConst.Separater_1); } sb.AppendFormat("{0}{1}", IsRepayment.ToString(), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", FrozenNo, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ProductKind, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", LatestTime.ToString("yyyy-MM-dd HH:mm:ss"), WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", CapitalRate, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", DepositRate, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ProceduresRate, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ManagementRate, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", InterestRate, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", ServiceRate, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BranchKey, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", BranchKeyName, WebServiceConst.Separater_1); sb.AppendFormat("{0}{1}", Region, WebServiceConst.Separater_1); sb.Append(RegionName); return(sb.ToString()); }
/// <summary> /// 处理业务数据 /// </summary> public void DisposeBusinessData(int OperatorType, string UserLonginID = null) { #region B_TargetPlan ReportModelA = B_TargetplanOperator.Instance.GetTargetplan(BusinessID.ToGuid()); if (ReportModelA.WFStatus == "Draft") { ReportModelA.CreateTime = DateTime.Now; } var p = BPF.Workflow.Client.WFClientSDK.GetProcess(null, ReportModelA.ID.ToString(), UserLonginID); List <NavigatActivity1> listna = new List <NavigatActivity1>(); NavigatActivity1 na1 = null; Dictionary <string, BPF.Workflow.Object.Node> list = new Dictionary <string, BPF.Workflow.Object.Node>(); string strNextNodeID = p.ProcessInstance.StartNodeID; if (p.NodeInstanceList != null) { foreach (var p1 in p.NodeInstanceList) { if (!string.IsNullOrEmpty(strNextNodeID)) { var CurrentNode = p.NodeInstanceList[strNextNodeID]; list.Add(strNextNodeID, CurrentNode); strNextNodeID = CurrentNode.NextNodeID; } } foreach (var p1 in list) { if (string.IsNullOrEmpty(p1.Value.ParentNodeID)) { na1 = new NavigatActivity1(); na1.ActivityID = p1.Value.NodeID; na1.ActivityName = p1.Value.NodeName; na1.ActivityType = p1.Value.NodeType; na1.RunningStatus = (p1.Value.Status > 1 ? 3 : p1.Value.Status); List <ClientOpinion1> listclientOp = new List <ClientOpinion1>(); listclientOp.Add(new ClientOpinion1() { CreateDate = p1.Value.FinishDateTime }); na1.Opinions = listclientOp; List <NavigatCandidate1> listnc = new List <NavigatCandidate1>(); var lstNode = p.NodeInstanceList.Where(s => s.Value.ParentNodeID == p1.Value.NodeID); if (lstNode.Count() > 0) { foreach (var itme in lstNode) { listnc.Add(new NavigatCandidate1() { Id = itme.Value.User.UserID, Name = itme.Value.User.UserName, Title = itme.Value.User.UserJobName, DeptName = itme.Value.User.UserOrgPathName, Completed = itme.Value.Status == 2 ? true : false }); } } else { listnc.Add(new NavigatCandidate1() { Id = p1.Value.User.UserID, Name = p1.Value.User.UserName, Title = p1.Value.User.UserJobName, DeptName = p1.Value.User.UserOrgPathName, Completed = p1.Value.Status == 2 ? true : false }); } na1.Candidates = listnc; listna.Add(na1); } } } string Json = Newtonsoft.Json.JsonConvert.SerializeObject(listna); if (ReportModelA.WFStatus == "Draft" && OperatorType == 7) { ReportModelA.ReportApprove = null; } else { ReportModelA.ReportApprove = Json; } B_TargetplanOperator.Instance.UpdateTargetplan(ReportModelA); #endregion }
public void ProcessRequest(HttpContext context) { string logMessage = "{\"Name\":\"分解指标审批\",\"Context\":"; try { if ("post".Equals(context.Request.HttpMethod.ToLower())) { StreamReader reader = new StreamReader(context.Request.InputStream); logMessage += HttpUtility.UrlDecode(reader.ReadToEnd()); } // Get方式下,取得client端传过来的数据 else { // 注意,这个是需要解码的 logMessage += HttpUtility.UrlDecode(context.Request.QueryString.ToString()); } this.BusinessID = context.Request["BusinessID"]; if (!string.IsNullOrEmpty(context.Request["OperatorType"])) { OperatorType = int.Parse(context.Request["OperatorType"]); } string strPrcessStatus = string.Empty; if (!string.IsNullOrEmpty(context.Request["PrcessStatus"])) { strPrcessStatus = context.Request["PrcessStatus"]; } if (string.IsNullOrEmpty(this.BusinessID)) { throw new Exception("BusinessID is null!"); } else { //添加谁点击了提交审批按钮 B_TargetPlan ReportModel = B_TargetplanOperator.Instance.GetTargetPlanByID(BusinessID.ToGuid()); if (string.IsNullOrEmpty(ReportModel.ProcessOwn)) { ReportModel.ProcessOwn = this.CurrentUser; B_TargetplanOperator.Instance.UpdateTargetplan(ReportModel); } } if (strPrcessStatus != "Approved") { OnProcessExecute(strPrcessStatus, OperatorType); } else { //审批结束,调用这个 OnProecssCompleted(); StaticResource.Instance.Reload(); } //处理数据 DisposeBusinessData(OperatorType); } catch (Exception ex) { logMessage += ",\"Exception\":" + JsonConvert.SerializeObject(ex); } finally { logger.Info(logMessage + "}"); } }
/// <summary> /// 审批结束,调用 /// </summary> public void OnProecssCompleted() { B_TargetPlan rpt = B_TargetplanOperator.Instance.GetTargetPlanByID(BusinessID.ToGuid()); List <B_TargetPlanDetail> rptDetailList = B_TargetplandetailOperator.Instance.GetTargetplandetailList(BusinessID.ToGuid()).ToList(); ExceptionHelper.TrueThrow(rpt == null, string.Format("cannot find the report data which id={0}", BusinessID)); rpt.WFStatus = "Approved"; if (!B_TargetplanOperator.Instance.HasDefaultVersion(rpt.SystemID, rpt.FinYear)) { rpt.VersionDefault = 1; } B_TargetplanOperator.Instance.UpdateTargetplan(rpt); //A_TargetPlan rptA = null; List <A_TargetPlanDetail> rptTempDetailList = new List <A_TargetPlanDetail>(); //List<A_TargetPlanDetail> rptADetailList = null; A_TargetplanOperator.Instance.AddTargetplan( new A_TargetPlan() { ID = rpt.ID, VersionName = rpt.VersionName, VersionDefault = rpt.VersionDefault, FinYear = rpt.FinYear, Description = rpt.Description, SystemID = rpt.SystemID, Status = 5, CreateTime = DateTime.Now }); rptDetailList.ForEach(p => rptTempDetailList.Add(p.ToAModel())); A_TargetplandetailOperator.Instance.AddTargetPlanDetailList(rptTempDetailList); #region 原有逻辑 //A主表的的数据 //rptA = A_TargetplanOperator.Instance.GetTargetplanList(rpt.SystemID, rpt.FinYear).FirstOrDefault(); ////A表明细数据 //rptADetailList = A_TargetplandetailOperator.Instance.GetTargetplandetailList(rpt.SystemID, rpt.FinYear).ToList(); ////判断当月主表是否是null //if (rptA == null) //{ // A_TargetplanOperator.Instance.AddTargetplan(new A_TargetPlan() { ID = rpt.ID, FinYear = rpt.FinYear, Description = rpt.Description, SystemID = rpt.SystemID, Status = 5, CreateTime = DateTime.Now }); // //判断A 明细 // if (rptADetailList.Count == 0) // { // #region 明细数据 // //将B 表数据添加到 A表中 // rptDetailList.ForEach(p => rptTempDetailList.Add(p.ToAModel())); // #endregion // } // else // { // //删除A表明细的所有数据 // A_TargetplandetailOperator.Instance.DeleteTargetPlanDetailList(rptADetailList); // #region 明细数据 // //将B 表数据添加到 A表中 // rptDetailList.ForEach(p => rptTempDetailList.Add(p.ToAModel())); // #endregion // } // //添加明细数据 // A_TargetplandetailOperator.Instance.AddTargetPlanDetailList(rptTempDetailList); //} //else //{ // //上来删除主表的ID // A_TargetplanOperator.Instance.DeleteModel(rptA); // //新增B表的主表数据 // A_TargetplanOperator.Instance.AddTargetplan(new A_TargetPlan() { ID = rpt.ID, FinYear = rpt.FinYear, Description = rpt.Description, SystemID = rpt.SystemID, Status = 5, CreateTime = DateTime.Now }); // //B表转换到A表 // if (rptADetailList.Count == 0) // { // #region 明细数据 // //将B 表数据添加到 A表中 // rptDetailList.ForEach(p => rptTempDetailList.Add(p.ToAModel())); // #endregion // } // else // { // //删除A表明细的所有数据 // A_TargetplandetailOperator.Instance.DeleteTargetPlanDetailList(rptADetailList); // #region 明细数据 // //将B 表数据添加到 A表中 // rptDetailList.ForEach(p => rptTempDetailList.Add(p.ToAModel())); // #endregion // } // //添加明细数据 // A_TargetplandetailOperator.Instance.AddTargetPlanDetailList(rptTempDetailList); //} #endregion }
/// <summary> /// 记录工作流状态,针对退回特殊处理 /// </summary> /// <param name="rpt"></param> /// <param name="IsProType">是否是批次</param> protected void WorkFlowStatus(B_MonthlyReport rpt, bool IsProBatch) { //有效流程状态:Progress, Approved //4-return, 9 -withdraw if (OperaionType == 6 || OperaionType == 7) { rpt.WFStatus = "Draft"; if (OperaionType == 6) //退回操作 { if (IsProBatch) { WorkflowContext wfc = WFClientSDK.GetProcess(null, rpt.ID.ToString(), new UserInfo() { UserCode = "$VirtualUserCode$虚拟汇总人" }); BizContext bizContext = new BizContext(); bizContext.NodeInstanceList = wfc.NodeInstanceList; bizContext.ProcessRunningNodeID = wfc.ProcessInstance.RunningNodeID; bizContext.BusinessID = rpt.ID.ToString(); bizContext.ApprovalContent = "项目汇总退回服务发起"; bizContext.CurrentUser = new UserInfo() { UserCode = "$VirtualUserCode$虚拟汇总人" }; bizContext.ExtensionCommond = new Dictionary <string, string>(); bizContext.ExtensionCommond.Add("RejectNode", Guid.Empty.ToString()); WorkflowContext wf = WFClientSDK.ExecuteMethod("RejectProcess", bizContext); if (wf.StatusCode != 0) { throw new Exception("子流程退回到发起人没有成功,请联系管理员。"); } //ClientProcess.Return(rpt.ID.ToString(), "项目汇总退回服务发起", -1, null, "", false); //ClientProcess.Return(rpt.ID.ToString(), "这个是自动的服务意见", -1); } new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Return, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); } else if (OperaionType == 7) { new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Withdraw, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); rpt.WFStatus = "Draft"; } } else if (OperaionType == 9)//9, cancel { rpt.WFStatus = "Cancel"; new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Cancel, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); } else { if (rpt.WFStatus != "Approved") //这里为了避免通知节点的提交覆盖了审批完成状态,而添加的 { rpt.WFStatus = "Progress"; //CreatTime取流程提交时间,该时间为流程开始时间 rpt.ModifyTime = DateTime.Now; rpt.Status = 5; } new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Submit, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); } B_MonthlyreportOperator.Instance.UpdateMonthlyreport(rpt); }
/// <summary> /// 更新执行工作流后更新对应字段的值。如果是合并审批中退回,退回所有分支流程。 /// </summary> protected void ProcessExecuteBusinessData() { B_MonthlyReport tempRPT = null; B_MonthlyReport rpt = null; B_SystemBatch BacthModel = null; if (string.IsNullOrEmpty(ProType)) //非批次 { rpt = B_MonthlyreportOperator.Instance.GetMonthlyreport(BusinessID.ToGuid()); ExceptionHelper.TrueThrow(rpt == null, string.Format("cannot find the report data which id={0}", BusinessID)); } else //批次 { BacthModel = B_SystemBatchOperator.Instance.GetSystemBatch(BusinessID.ToGuid()); ExceptionHelper.TrueThrow(BacthModel == null, string.Format("cannot find the report data which id={0}", BusinessID)); } //WfOperationInfo wfop = JsonConvert.DeserializeObject<WfOperationInfo>(OperaionInfo); if (!string.IsNullOrEmpty(ProType)) //批次 { List <V_SubReport> monthRpt = JsonConvert.DeserializeObject <List <V_SubReport> >(BacthModel.SubReport); #region 所有子流程的状态 foreach (var item in monthRpt) { B_MonthlyReport _rpt = B_MonthlyreportOperator.Instance.GetMonthlyreport(item.ReportID); tempRPT = _rpt; ExceptionHelper.TrueThrow(_rpt == null, string.Format("cannot find the report data which id={0}", BusinessID)); //工作流状态,如果合并审批退回,退回所有分支流程 WorkFlowStatus(_rpt, true); //针对退回,单独做了处理 if (OperaionType == 6) { item.IsReady = false; } } #endregion //有效流程状态:Progress, Approved //6-return, 7 -withdraw #region 这个是整个批次的审批流程 if (OperaionType == 6 || OperaionType == 7) { BacthModel.WFBatchStatus = "Draft"; if (OperaionType == 6) { BacthModel.SubReport = JsonConvert.SerializeObject(monthRpt); new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Return, tempRPT.SystemID, tempRPT.FinYear, tempRPT.FinMonth, BusinessID.ToGuid()); } else if (OperaionType == 7) { new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Withdraw, tempRPT.SystemID, tempRPT.FinYear, tempRPT.FinMonth, BusinessID.ToGuid()); } } else if (OperaionType == 9)//9, cancel { BacthModel.WFBatchStatus = "Cancel"; new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Cancel, tempRPT.SystemID, tempRPT.FinYear, tempRPT.FinMonth, BusinessID.ToGuid()); } else { if (BacthModel.WFBatchStatus != "Approved") //这里为了避免通知节点的提交覆盖了审批完成状态,而添加的 { BacthModel.WFBatchStatus = "Progress"; } new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Submit, tempRPT.SystemID, tempRPT.FinYear, tempRPT.FinMonth, BusinessID.ToGuid()); } //修改批次数据 B_SystemBatchOperator.Instance.UpdateSystemBatch(BacthModel); #endregion } else //不含批次 { //工作流状态 WorkFlowStatus(rpt, false); new MonthlyReportLog().AddMonthlyReportAction((int)MonthlyReportLogActionType.Submit, rpt.SystemID, rpt.FinYear, rpt.FinMonth, BusinessID.ToGuid()); } }
/// <summary> ///新流程结束 /// </summary> protected void OnProcessCompletedBusinessData() { if (!string.IsNullOrEmpty(this.ProType))//批次 { B_SystemBatch sysBatch = B_SystemBatchOperator.Instance.GetSystemBatch(BusinessID.ToGuid()); ExceptionHelper.TrueThrow(sysBatch == null, string.Format("cannot find the report data which id={0}", BusinessID)); //获取批次A表中的数据 A_SystemBatch _sysBatch = A_SystemBatchOperator.Instance.GetSystemBatch("ProSystem", sysBatch.FinYear, sysBatch.FinMonth); if (_sysBatch == null) { AddBatchData(sysBatch); } else { //先删除数据,在添加数据 int succeed = A_SystemBatchOperator.Instance.DeleteSystemBatch(_sysBatch); ExceptionHelper.TrueThrow(succeed == 0, string.Format("批次表删除失败,批次ID:{0}", _sysBatch.ID)); AddBatchData(sysBatch); } } else { //不包含批次的 //这里通过BusinessID 获取流程批次的信息 B_MonthlyReport mrpt = B_MonthlyreportOperator.Instance.GetMonthlyreport(BusinessID.ToGuid()); ExceptionHelper.TrueThrow(mrpt == null, string.Format("cannot find the report data which id={0}", BusinessID)); List <B_MonthlyReportDetail> rptDetailList = B_MonthlyreportdetailOperator.Instance.GetMonthlyreportdetailList(mrpt.ID).ToList(); mrpt.WFStatus = "Approved"; B_MonthlyreportOperator.Instance.UpdateMonthlyreport(mrpt); //更新 BtoAData(mrpt, rptDetailList); } }