⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 processmanager.java

📁 是个执行管理类,里边的方法控制整个系统执行.是整个执行的支持与控制枢纽.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                    returnCheck(returnValue);
                }
            }
            BigDecimal iCount = null;
            boolean isRight = true;
            boolean transactionCtrlValue = systemInfoIn.isTransactCtrl();
            systemInfoIn.setTransactCtrl(false);
            returnValue = canCancel(systemInfoIn);
            systemInfoIn.setTransactCtrl(transactionCtrlValue);
            if(returnValue.getSystemInfoOut().getErrorCode() != null)
            {
                messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                isRight = false;
            } else
            {
                ProcessManager_canOut out = (ProcessManager_canOut)returnValue.getData();
                if(!out.getCanFlg())
                {
                    super.systemInfoOut.setErrorCode(ErrorCodeSupport.getBusinessError());
                    messageList.setMessage(null, null, "BS0004681G", 0x80000000);
                    isRight = false;
                }
            }
            actionStf = ((UserInfo)systemInfoIn.getExtend1()).getStfNo();
            actionStfCompanyCd = ((UserInfo)systemInfoIn.getExtend1()).getCompanyCd();
            actionDate = getSystemDate();
            if(isRight)
            {
                NodeTblD_selectMaxSubNoIn sIn = new NodeTblD_selectMaxSubNoIn();
                sIn.setCompanyCd(companyCd);
                sIn.setProcessType(processType);
                sIn.setProcessId(processId);
                sIn.setProcessNo(processNo);
                returnValue = s_NodeTblD_selectMaxSubNo(systemInfoIn, sIn);
                if(returnValue.getSystemInfoOut().getErrorCode() != null)
                {
                    messageList.setMessage(null, null, "BS0002480G", 0x80000000);
                    isRight = false;
                } else
                {
                    NodeTblD_selectMaxSubNoOut selectByPKOut = (NodeTblD_selectMaxSubNoOut)returnValue.getData();
                    iCount = selectByPKOut.getMaxProcessSubNo();
                }
            }
            if(isRight && !nodeType.equals("start"))
            {
                returnValue = getEffetiveStf(systemInfoIn, targetCompanyCd, targetStfNo, replaceTarget);
                String effCompanyCd = null;
                String effStfNo = null;
                if(returnValue.getSystemInfoOut().getErrorCode() != null)
                {
                    messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                    isRight = false;
                } else
                {
                    ProcessManager_getEffetiveStfOut out = (ProcessManager_getEffetiveStfOut)returnValue.getData();
                    effCompanyCd = out.getEffCompanyCd();
                    effStfNo = out.getEffStfNo();
                }
                returnValue = getCancelData(systemInfoIn, effCompanyCd, effStfNo);
                if(returnValue.getSystemInfoOut().getErrorCode() != null)
                {
                    messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                    isRight = false;
                }
                if(isRight)
                {
                    ProcessManager_getCancelDataOut out = (ProcessManager_getCancelDataOut)returnValue.getData();
                    boolean bCpAdd = out.isBCPAdd();
                    String sUsrNode = out.getSUsrNode();
                    BigDecimal iCpSubNo = out.getICpSubNo();
                    if(bCpAdd)
                    {
                        if(processSubNo.compareTo(iCpSubNo) > 0)
                            iCpSubNo = processSubNo;
                        returnValue = cancelNextIs(systemInfoIn, "admit", iCpSubNo, sUsrNode, iCount);
                        if(returnValue.getSystemInfoOut().getErrorCode() != null)
                        {
                            messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                            isRight = false;
                        }
                    } else
                    {
                        returnValue = cancelNextNo(systemInfoIn, "admit", iCount);
                        if(returnValue.getSystemInfoOut().getErrorCode() != null)
                        {
                            messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                            isRight = false;
                        }
                    }
                }
            } else
            if(isRight)
            {
                returnValue = cancelNextIs(systemInfoIn, "start", processSubNo, null, iCount);
                if(returnValue.getSystemInfoOut().getErrorCode() != null)
                {
                    messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                    isRight = false;
                }
            }
        }
        catch(Exception exception)
        {
            super.log.fatal(super.systemInfoOut.getErrorMessage());
            handleException(exception);
        }
        finally
        {
            super.systemInfoOut.setExtend1(messageList);
            returnValue.setSystemInfoOut(super.systemInfoOut);
            if(systemInfoIn.isTransactCtrl())
                closeTransaction();
            super.log.info("[END]");
            return returnCheck(returnValue);
        }
    }

    protected ReturnValue reserve(SystemInfoIn systemInfoIn)
    {
        ReturnValue returnValue = new ReturnValue();
        setLogInfo(systemInfoIn, returnValue.getSystemInfoOut(), "ProcessManager", "reserve");
        super.systemInfoOut.setErrorCode(null);
        MessageList messageList = new MessageList();
        super.log.info("[START]");
        try
        {
            if(systemInfoIn.isTransactCtrl())
            {
                if(!super.connectDB())
                    returnCheck(returnValue);
            } else
            {
                backupConnection();
                if(systemInfoIn.getConnection() == null)
                {
                    super.systemInfoOut.setErrorCode("EF0101");
                    super.systemInfoOut.setErrorMessage("no connection handle.");
                    super.log.fatal("no connection handle.");
                    returnCheck(returnValue);
                }
            }
            BigDecimal iCount = null;
            boolean isRight = true;
            boolean transactionCtrlValue = systemInfoIn.isTransactCtrl();
            systemInfoIn.setTransactCtrl(false);
            returnValue = canReserve(systemInfoIn);
            systemInfoIn.setTransactCtrl(transactionCtrlValue);
            if(returnValue.getSystemInfoOut().getErrorCode() != null)
            {
                messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                isRight = false;
            } else
            {
                ProcessManager_canOut out = (ProcessManager_canOut)returnValue.getData();
                if(!out.getCanFlg())
                {
                    super.systemInfoOut.setErrorCode(ErrorCodeSupport.getBusinessError());
                    messageList.setMessage(null, null, "BS0004682G", 0x80000000);
                    isRight = false;
                }
            }
            actionStf = ((UserInfo)systemInfoIn.getExtend1()).getStfNo();
            actionStfCompanyCd = ((UserInfo)systemInfoIn.getExtend1()).getCompanyCd();
            actionDate = getSystemDate();
            if(isRight)
                if(nodeType.equals("start") && nodeStatus.equals(""))
                {
                    if(exclusiveKeyPro == null)
                    {
                        ProcessTblD_selectByPKIn dIn = new ProcessTblD_selectByPKIn();
                        dIn.setCompanyCd(companyCd);
                        dIn.setProcessType(processType);
                        dIn.setProcessId(processId);
                        dIn.setProcessNo(processNo);
                        returnValue = s_ProcessTblD_selectByPK(systemInfoIn, dIn);
                        if(returnValue.getSystemInfoOut().getErrorCode() != null)
                        {
                            messageList.setMessage(null, null, "BS0002480G", 0x80000000);
                            isRight = false;
                        } else
                        if(returnValue.getSystemInfoOut().getHitCount() == 0)
                        {
                            super.systemInfoOut.setErrorCode(ErrorCodeSupport.getBusinessError());
                            messageList.setMessage(null, null, "BS0001060G", 0x80000000);
                            isRight = false;
                        } else
                        {
                            ProcessTblD_selectByPKOut dOut = (ProcessTblD_selectByPKOut)returnValue.getData();
                            ProcessTbl_st process_St = dOut.getProcessTbl();
                            exclusiveKeyPro = process_St.getExclusiveKey();
                        }
                    }
                    returnValue = insertNodeTblNew(systemInfoIn, "reserve", "start");
                    if(returnValue.getSystemInfoOut().getErrorCode() != null)
                    {
                        messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                        isRight = false;
                    } else
                    {
                        processStatus = "1";
                    }
                } else
                {
                    String node = "";
                    if(nodeType.equals("start"))
                        node = "start";
                    else
                        node = "admit";
                    returnValue = updateNodeTblBy(systemInfoIn, "reserve", node);
                    if(returnValue.getSystemInfoOut().getErrorCode() != null)
                    {
                        messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                        isRight = false;
                    }
                }
            if(isRight)
            {
                returnValue = addAttachFile(systemInfoIn);
                if(returnValue.getSystemInfoOut().getErrorCode() != null)
                {
                    messageList.addAll((MessageList)returnValue.getSystemInfoOut().getExtend1());
                    isRight = false;
                }
            }
            if(isRight)
            {
                ProcessTblD_updateByPKIn upIn = new ProcessTblD_updateByPKIn();
                ProcessTbl_st tblst = new ProcessTbl_st();
                tblst.setCompanyCd(companyCd);
                tblst.setProcessType(processType);
                tblst.setProcessId(processId);
                tblst.setProcessNo(processNo);
                tblst.setProcessStatus(processStatus);
                tblst.setAttachFlg(attachFlg);
                tblst.setExclusiveKey(exclusiveKeyPro);
                upIn.setProcessTbl(tblst);
                returnValue = s_ProcessTblD_updateByPK(systemInfoIn, upIn);
                if(returnValue.getSystemInfoOut().getErrorCode() != null)
                {
                    messageList.setMessage(null, null, "BS0002480G", 0x80000000);
                    isRight = false;
                }
            }
        }
        catch(Exception exception)
        {
            super.log.fatal(super.systemInfoOut.getErrorMessage());
            handleException(exception);
        }
        finally
        {
            super.systemInfoOut.setExtend1(messageList);
            returnValue.setSystemInfoOut(super.systemInfoOut);
            if(systemInfoIn.isTransactCtrl())
                closeTransaction();
            super.log.info("[END]");
            return returnCheck(returnValue);
        }
    }

    protected ReturnValue back(SystemInfoIn systemInfoIn)
    {
        ReturnValue returnValue = new ReturnValue();
        setLogInfo(systemInfoIn, returnValue.getSystemInfoOut(), "ProcessManager", "cancel");
        super.systemInfoOut.setErrorCode(null);
        MessageList messageList = new MessageList();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -