调整脚本
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.tem.bocai.schedules;
|
||||
|
||||
import com.tem.bocai.service.LoginService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -129,7 +130,7 @@ public class BetSchedule {
|
||||
System.out.println(" - 从json文件中获取投注数据...");
|
||||
JSONArray betDataArray = readBetDataFromJson();
|
||||
|
||||
// 2. 遍历投注数据并执行投注
|
||||
// 2. 遍历投注数据并执行投注 构建投注json
|
||||
for (int i = 0; i < betDataArray.length(); i++) {
|
||||
JSONObject betData = betDataArray.getJSONObject(i);
|
||||
String time = betData.getString("time");
|
||||
@@ -138,14 +139,17 @@ public class BetSchedule {
|
||||
// 获取投注号码
|
||||
JSONObject result = betData.getJSONObject("result");
|
||||
JSONArray betNumbers = new JSONArray();
|
||||
for (int j = 0; j < 10; j++) {
|
||||
JSONObject posData = result.getJSONObject(String.valueOf(j));
|
||||
for (String num : posData.keySet()) {
|
||||
if (posData.get(num) != null) {
|
||||
betNumbers.put(num);
|
||||
result.keySet().forEach(key -> {
|
||||
JSONObject betNumber = new JSONObject();
|
||||
JSONObject posData = result.getJSONObject(key);
|
||||
posData.keySet().forEach(num -> {
|
||||
Object o = posData.get(num);
|
||||
if (ObjectUtils.isNotEmpty(o) && !o.toString().equals("null")) {
|
||||
betNumber.put(num, posData.get(num));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
betNumbers.put(betNumber);
|
||||
});
|
||||
System.out.println(" - 投注号码: " + betNumbers.toString());
|
||||
|
||||
// 计算投注金额
|
||||
|
||||
Reference in New Issue
Block a user