Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
    }