jiazx0107@163.com
2023-11-09 1f5947ccb5b02817dbe5aaae943c0a7fcfc2cd62
src/main/java/com/fzzy/gateway/hx2023/service/HxGatewaySyncGrainImpl.java
@@ -70,8 +70,10 @@
        double tMIn = 20, tMax = 25;
        if (null != weather) {
            double tOut = Double.valueOf(weather.getTem());
            tMIn = tOut - 2;
            tMax = tOut + 3;
            tMIn = tOut - 4;
            if(tMIn < 4)tMIn = 5;
            tMax = tOut + 0;
            if(tMax< 15)tMax = 15;
        }
@@ -103,7 +105,26 @@
        double randomNumber = tMIn;
        int x = 0, y = 0, z = 0;
        for (int i = 0; i < sumNum; i++) {
            randomNumber = Math.random() * (tMax - tMIn + 1) + tMIn;
            if((i) % Integer.valueOf(cableRule[0]) == 0){
                randomNumber = Math.random() * (tMax - tMIn + 1) + tMIn;
            } else if ((i) % Integer.valueOf(cableRule[0]) == 1) {
                randomNumber = Math.random() * (tMax - tMIn + 1) + tMIn;
            }else if ((i) % Integer.valueOf(cableRule[0]) == 2) {
                randomNumber = Math.random() * (tMax - tMIn + 1) + tMIn;
            }else if ((i) % Integer.valueOf(cableRule[0]) == 3) {
                randomNumber = Math.random() * (tMax - tMIn + 1) + tMIn;
            }else if ((i) % Integer.valueOf(cableRule[0]) == 4) {
                randomNumber = Math.random() * (tMax - tMIn + 1) + tMIn;
            }else {
                randomNumber = Math.random() * (tMax - tMIn + 1) + tMIn;
            }
           // randomNumber = Math.random() * (tMax - tMIn + 1) + tMIn;
            curTemp = NumberUtil.keepPrecision(randomNumber, 1);
            position = i;
            z = i % cableZ + 1;