liurunyu
2024-11-19 4e4bcc8e95fef11e695d476da4e761399d3c7247
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java
@@ -219,13 +219,36 @@
            return ;
        }
        int n = Integer.parseInt(new CreateRandom().create(2)) ;
        if(n == 44 || n == 45 || n == 54){
        if(n == 4
                || n == 14
                || n == 24
                || n == 34
                || n == 44
                || n == 54
                || n == 64
                || n == 74
                || n == 84
                || n == 95
                || n == 45
                || n == 46
                || n == 47
                || n == 48
                || n == 49){
            if(rtu.currentPackage == 1){
                //1包死
                rtu.state = UpgradeRtu.STATE_FAILONE ;
                return ;
            }
        }
        if(n == 45){
            if(rtu.currentPackage != 1){
                //升死
                rtu.state = UpgradeRtu.STATE_FAIL ;
                return ;
            }
        }
        if(rtu.currentPackage == rtu.totalPackage){
            //升级结束
            rtu.state = UpgradeRtu.STATE_SUCCESS ;
@@ -233,12 +256,16 @@
            return ;
        }
        rtu.state = UpgradeRtu.STATE_RUNNING ;
        rtu.currentPackage += 1 ;
        rtu.currentRamAddr = 0x00 + UpgradeRtu.RAMADDRADD ;
        rtu.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
        rtu.reTryTimes = 0 ;
        rtu.isOver = false ;
        if(rtu.state != UpgradeRtu.STATE_FAILONE &&
                rtu.state != UpgradeRtu.STATE_FAIL){
            rtu.state = UpgradeRtu.STATE_RUNNING ;
            rtu.currentPackage += 1 ;
            rtu.currentRamAddr = 0x00 + UpgradeRtu.RAMADDRADD ;
            rtu.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
            rtu.reTryTimes = 0 ;
            rtu.isOver = false ;
        }
    }
    /**
@@ -249,6 +276,7 @@
        boolean hasRunning = false ;
        if(cache.ugRtuStateList != null && cache.ugRtuStateList.size() > 0){
            cache.ugOverallState.init();
            cache.ugOverallState.rtuTotal = cache.ugRtuStateList.size() ;
            for(UpgradeRtu rtu : cache.ugRtuStateList){
                if(rtu.state == UpgradeRtu.STATE_OFFLINE){
                    cache.ugOverallState.offLineTotal ++ ;