代码
import java.util.Random;class getNUmberUtils{public static int getRandNumber() {Random random = new Random();int[] num = {98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178};int i = random.nextInt(num.length);return num[i];}}int num = getNUmberUtils.getRandNumber();log.info(\"---------\");log.info(num.toString());vars.put(\"productSkuId\",num.toString());//第二种int[] nums = {98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178};int number=num[${__Random(0,32,)}]log.info(\"~~~~~~~~~~~~~\")log.info(string.valueOf(number));
结果