|
@@ -247,8 +247,8 @@ public class ParkSystemServiceImpl implements ParkSystemService {
|
|
|
JSONObject exceptionObj = mongoTemplate.findById(code + "_" + format, JSONObject.class, ParkType.EXCEPTION.getCode());
|
|
|
JSONObject exceptionData = exceptionObj != null ? exceptionObj.getJSONObject("data") : null;
|
|
|
JSONObject exceptionObjOld = mongoTemplate.findById(code + "_" + formatOld, JSONObject.class, ParkType.EXCEPTION.getCode());
|
|
|
- ParkExceptionType.codeList().forEach(x -> exceptionCountResult.set(exceptionObj == null ? 0 : (exceptionObj.getDouble(x + "Count") == null ? 0 : exceptionObj.getDouble(x + "Count").intValue() + exceptionCountResult.get())));
|
|
|
- ParkExceptionType.codeList().forEach(x -> exceptionCountOldResult.set(exceptionObjOld == null ? 0 : (exceptionObjOld.getDouble(x + "Count") == null ? 0 : exceptionObjOld.getDouble(x + "Count").intValue() + exceptionCountOldResult.get())));
|
|
|
+ ParkExceptionType.codeList().forEach(x -> exceptionCountResult.set(exceptionObj == null ? 0 : (exceptionObj.getDouble(x + "Count") == null ? 0 : exceptionObj.getDouble(x + "Count").intValue()) + exceptionCountResult.get()));
|
|
|
+ ParkExceptionType.codeList().forEach(x -> exceptionCountOldResult.set(exceptionObjOld == null ? 0 : (exceptionObjOld.getDouble(x + "Count") == null ? 0 : exceptionObjOld.getDouble(x + "Count").intValue()) + exceptionCountOldResult.get()));
|
|
|
Double inCount = inObj == null ? 0 : inObj.getDouble("count");
|
|
|
Double inCountOld = inObjOld == null ? 0 : inObjOld.getDouble("count");
|
|
|
Double outCount = outObj == null ? 0 : outObj.getDouble("count");
|
|
@@ -607,13 +607,15 @@ public class ParkSystemServiceImpl implements ParkSystemService {
|
|
|
List<Levi> list = new ArrayList<>();
|
|
|
Levi result = Levi.create();
|
|
|
ParkExceptionType.codeList().forEach(x -> result.set(x, 0));
|
|
|
- JSONObject obj = mongoTemplate.findById(ParkType.EXCEPTION.getCode(), JSONObject.class, ParkType.EXCEPTION.getCode());
|
|
|
- if (obj == null) {
|
|
|
- result.keySet().forEach(x -> list.add(Levi.by("name", ParkExceptionType.getTypeByCode(x.toString()).getName()).set("code", x).set("count", result.get(x))));
|
|
|
- return ResponseBuilder.ok(list);
|
|
|
- }
|
|
|
- parkCodeList.forEach(code -> ParkExceptionType.codeList().forEach(x -> result.set(x, result.getInt(x) + (obj.getInteger(x + "Count") == null ? 0 : obj.getInteger(x + "Count")))));
|
|
|
- result.keySet().forEach(x -> list.add(Levi.by("name", ParkExceptionType.getTypeByCode(x.toString()).getName()).set("code", x).set("count", result.get(x))));
|
|
|
+ parkCodeList.forEach(code -> {
|
|
|
+ String format = LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.PURE_DATE_PATTERN);
|
|
|
+ JSONObject obj = mongoTemplate.findById(code + "_" + format, JSONObject.class, ParkType.EXCEPTION.getCode());
|
|
|
+ if (obj == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ParkExceptionType.codeList().forEach(x -> result.set(x, result.getInt(x) + (obj.getInteger(x + "Count") == null ? 0 : obj.getInteger(x + "Count"))));
|
|
|
+ });
|
|
|
+ result.keySet().forEach(x -> list.add(Levi.by("name", ParkExceptionType.getTypeByCode(x.toString()).getName()).set("code", x).set("count", result.getInt(x))));
|
|
|
return ResponseBuilder.ok(list);
|
|
|
}
|
|
|
|