/// <summary> /// 可以继续覆盖重写 /// </summary> /// <param name="k2_workflowId"></param> /// <param name="dataFields"></param> /// <returns></returns> public override Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo DoServiceEvent(int k2_workflowId, SerializableDictionary <string, string> dataFields) { Logger.logger.DebugFormat("Params:{0},{1}", k2_workflowId, dataFields.Keys.Count); foreach (KeyValuePair <string, string> item in dataFields) { Logger.logger.DebugFormat("df:{0}-{1}", item.Key, item.Value); } Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo info = new Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo(); try { string erpFormCode = GetErpFormIdByWorkflowId(k2_workflowId, dataFields); string[] toErpString = CallbackStatus.Split(','); string resultString = dataFields["IsPass"] == "1" ? toErpString[0] : toErpString[1]; Logger.logger.DebugFormat("Proc:{0},{1}", erpFormCode, resultString); if (BeforeNotify(k2_workflowId, dataFields)) { ERP_CallbackResultInfo resultInfo = InvokeService_ERP.InvokeServiceAdvance(new CallbackInfo() { FormCode = erpFormCode, FormType = GetErpFormType().ToString(), Status = resultString }); AfterNotify(k2_workflowId, dataFields, resultInfo); if (resultInfo.ResultType == ERP_CallbackResultType.调用成功) { info.IsSuccess = true; } else { info.IsSuccess = false; info.ExecException = "接口调用成功,erp接口返回失败:" + resultInfo.resultXml; } } else { info.IsSuccess = false; } } catch (Exception ex) { info.ExecException = ex.StackTrace; info.IsSuccess = false; } Logger.logger.DebugFormat("Result:{0}", info.IsSuccess); Logger.logger.DebugFormat("Result-e:{0}", info.ExecException); if (!IsDebug) { DoSendEmail(k2_workflowId); } return(info); }
public override Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo DoServiceEvent(int k2_workflowId, Pkurg.PWorldBPM.FinallyDisposeServices.SerializableDictionary <string, string> dataFields) { Logger.logger.DebugFormat("OA_InstructionOfEToG_Params:{0},{1}", k2_workflowId, dataFields["IsReport"] == "1" ? "上报" : "不上报"); Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo info = new Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo(); try { if (dataFields["IsReport"] == "1") { Pkurg.PWorldBPM.Business.BIZ.InstructionOfEToGInfo companyInfo = new Pkurg.PWorldBPM.Business.BIZ.InstructionOfEToG().GetInfoByWfId(k2_workflowId.ToString()); Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstanceInfo instanceInfo = Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstances.GetWorkFlowInstanceByWfId(k2_workflowId.ToString()); Pkurg.PWorldBPM.Business.Controls.WF_Approval_RecordInfo flowManagerInfo = Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstances.GetApproval_RecordByIdAndName(instanceInfo.InstanceID, "流程审核员审核"); if (companyInfo != null) { ///增加表单 string formId = Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstances.GetSerialNumber("OA_QS_"); new Pkurg.PWorldBPM.Business.BIZ.InstructionOfGroup().Insert(new Pkurg.PWorldBPM.Business.BIZ.InstructionOfGroupInfo() { Content = companyInfo.Content, Title = companyInfo.Title, SecurityLevel = companyInfo.SecurityLevel, UrgenLevel = companyInfo.UrgenLevel, Mobile = companyInfo.Mobile, //UserName = companyInfo.UserName, UserName = flowManagerInfo.ApproveByUserName, DeptCode = companyInfo.DeptCode, DeptName = companyInfo.DeptName, FormID = formId, RelatedFormID = companyInfo.FormID //relation }); ///增加实例 string instanceId = Guid.NewGuid().ToString(); Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstances.AddWorkFlowInstance(new Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstanceInfo() { AppID = "3003", InstanceID = instanceId, FormID = formId, FormTitle = instanceInfo.FormTitle, WFStatus = "0", CreateAtTime = DateTime.Now, CreateByUserCode = flowManagerInfo.ApproveByUserCode, CreateByUserName = flowManagerInfo.ApproveByUserName, UpdateAtTime = DateTime.Now, UpdateByUserCode = flowManagerInfo.ApproveByUserCode, UpdateByUserName = flowManagerInfo.ApproveByUserName, CreateDeptCode = instanceInfo.CreateDeptCode, CreateDeptName = instanceInfo.CreateDeptName, WFInstanceId = "0" }); ///关联流程 Pkurg.PWorldBPM.Business.Controls.WF_Relation.AddRelatedFlowInfo(instanceId, instanceInfo.InstanceID, flowManagerInfo.ApproveByUserName); Logger.logger.Debug("上报成功"); } } else { info.ExecException = "无需上报"; } info.IsSuccess = true; } catch (Exception ex) { info.ExecException = ex.Message + "\r\n" + ex.StackTrace; Logger.logger.DebugFormat("上报失败:{0}\r\n{1}", ex.Message, ex.StackTrace); } return(info); }
public override Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo DoServiceEvent(int k2_workflowId, Pkurg.PWorldBPM.FinallyDisposeServices.SerializableDictionary <string, string> dataFields) { Logger.logger.DebugFormat("OA_ContractAuditOfEToG_Params:{0},{1}", k2_workflowId, dataFields["IsReport"] == "1" ? "上报" : "不上报"); Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo info = new Pkurg.PWorldBPM.FinallyDisposeServices.ExecuteResultInfo(); try { if (dataFields["IsReport"] == "1") { Pkurg.PWorldBPM.Business.BIZ.OA.ContractAuditOfEToGInfo companyInfo = new Pkurg.PWorldBPM.Business.BIZ.OA.ContractAuditOfEToG().GetInfoByWfId(k2_workflowId.ToString()); Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstanceInfo instanceInfo = Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstances.GetWorkFlowInstanceByWfId(k2_workflowId.ToString()); Pkurg.PWorldBPM.Business.Controls.WF_Approval_RecordInfo flowManagerInfo = Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstances.GetApproval_RecordByIdAndName(instanceInfo.InstanceID, "流程审核员审核"); if (companyInfo != null) { ///增加表单 string formId = Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstances.GetSerialNumber("OA_HT_"); new Pkurg.PWorldBPM.Business.BIZ.OA.ContractAuditOfGroup().Insert(new Pkurg.PWorldBPM.Business.BIZ.OA.ContractAuditOfGroupInfo() { FormID = formId, SecurityLevel = companyInfo.SecurityLevel, UrgenLevel = companyInfo.UrgenLevel, DeptName = companyInfo.DeptName, DeptCode = companyInfo.DeptCode, UserName = flowManagerInfo.ApproveByUserName, Mobile = companyInfo.Mobile, DateTime = companyInfo.DateTime, ContractSum = companyInfo.ContractSum, IsSupplementProtocol = companyInfo.IsSupplementProtocol, IsSupplementProtocolText = companyInfo.IsSupplementProtocolText, IsFormatContract = companyInfo.IsFormatContract, IsNormText = companyInfo.IsNormText, IsBidding = companyInfo.IsBidding, IsEstateProject = companyInfo.IsEstateProject, EstateProjectName = companyInfo.EstateProjectName, EstateProjectNameText = companyInfo.EstateProjectNameText, EstateProjectNum = companyInfo.EstateProjectNum, EstateProjectNumText = companyInfo.EstateProjectNumText, ContractTitle = companyInfo.ContractTitle, ContractContent = companyInfo.ContractContent, LeadersSelected = "", IsReport = "", IsApproval = "", ContractType1 = companyInfo.ContractType1, ContractTypeName1 = companyInfo.ContractTypeName1, ContractType2 = companyInfo.ContractType2, ContractTypeName2 = companyInfo.ContractTypeName2, ContractType3 = companyInfo.ContractType3, ContractTypeName3 = companyInfo.ContractTypeName3, ContractSubject = companyInfo.ContractSubject, ContractSubjectName = companyInfo.ContractSubjectName, ContractSubjectName2 = companyInfo.ContractSubjectName2, ContractSubjectName3 = companyInfo.ContractSubjectName3, ContractSubjectName4 = companyInfo.ContractSubjectName4, RelatedFormID = companyInfo.FormID }); ///增加实例 string instanceId = Guid.NewGuid().ToString(); Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstances.AddWorkFlowInstance(new Pkurg.PWorldBPM.Business.Controls.WF_WorkFlowInstanceInfo() { AppID = "3007", InstanceID = instanceId, FormID = formId, FormTitle = instanceInfo.FormTitle, WFStatus = "0", CreateAtTime = DateTime.Now, CreateByUserCode = flowManagerInfo.ApproveByUserCode, CreateByUserName = flowManagerInfo.ApproveByUserName, UpdateAtTime = DateTime.Now, UpdateByUserCode = flowManagerInfo.ApproveByUserCode, UpdateByUserName = flowManagerInfo.ApproveByUserName, CreateDeptCode = instanceInfo.CreateDeptCode, CreateDeptName = instanceInfo.CreateDeptName, WFInstanceId = "0" }); ///关联流程 Pkurg.PWorldBPM.Business.Controls.WF_Relation.AddRelatedFlowInfo(instanceId, instanceInfo.InstanceID, flowManagerInfo.ApproveByUserName); Logger.logger.Debug("上报成功"); } } else { info.ExecException = "无需上报"; } info.IsSuccess = true; } catch (Exception ex) { info.ExecException = ex.Message + "\r\n" + ex.StackTrace; Logger.logger.DebugFormat("上报失败:{0}\r\n{1}", ex.Message, ex.StackTrace); } return(info); }