修改页面和接口

This commit is contained in:
liuwu 2023-09-19 10:05:19 +08:00
parent 09a1d68bd4
commit ffd6f28797
1 changed files with 8 additions and 1 deletions

View File

@ -145,13 +145,17 @@ public class BigScreenController extends BaseController {
JSONArray dataArray = new JSONArray(); JSONArray dataArray = new JSONArray();
String month = DateUtils.parseDateToStr("YYYY-MM", new Date()); String month = DateUtils.parseDateToStr("YYYY-MM", new Date());
list.forEach(l -> { list.forEach(l -> {
typeArray.add(l.get("type")); String month1 = l.get("month").toString();
if (month1.equals(month)){
typeArray.add(l.get("type"));
}
JSONArray array = JSONArray.parseArray("[" + l.get("json").toString() + "]"); JSONArray array = JSONArray.parseArray("[" + l.get("json").toString() + "]");
array.forEach(a -> { array.forEach(a -> {
Map<String, Object> m = (Map<String, Object>) a; Map<String, Object> m = (Map<String, Object>) a;
tradeMap.put(m.get("label").toString(), m.get("label").toString()); tradeMap.put(m.get("label").toString(), m.get("label").toString());
yearCount.addAndGet(Integer.parseInt(m.get("count").toString())); yearCount.addAndGet(Integer.parseInt(m.get("count").toString()));
yearMoney.updateAndGet(v -> new Double((double) (v + Double.parseDouble(m.get("trade").toString())))); yearMoney.updateAndGet(v -> new Double((double) (v + Double.parseDouble(m.get("trade").toString()))));
}); });
}); });
// 所有小分类 // 所有小分类
@ -162,6 +166,9 @@ public class BigScreenController extends BaseController {
// 三个大分类 // 三个大分类
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
String month1 = list.get(i).get("month").toString(); String month1 = list.get(i).get("month").toString();
if (!month1.equals(month)){
continue;
}
JSONArray array = JSONArray.parseArray("[" + list.get(i).get("json").toString() + "]"); JSONArray array = JSONArray.parseArray("[" + list.get(i).get("json").toString() + "]");
AtomicInteger count = new AtomicInteger(); AtomicInteger count = new AtomicInteger();
AtomicReference<Double> trade = new AtomicReference<>(0.0); AtomicReference<Double> trade = new AtomicReference<>(0.0);