From ed7b8b75a29bf88573ab12d94652177328a850e8 Mon Sep 17 00:00:00 2001 From: yixian Date: Wed, 12 Aug 2020 12:18:40 +1000 Subject: [PATCH] valid calendar warning level --- .../management/clearing/core/impl/CleanServiceImpl.java | 5 +++++ .../static/payment/validation/templates/valid-calendar.html | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 310aaacc6..2880b4554 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -170,6 +170,11 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider JSONObject item = new JSONObject(); item.put("date", DateFormatUtils.format(report.getDate("valid_date"), "yyyy/MM/dd")); JSONObject result = JSON.parseObject(report.getString("result")); + int warningLevel = result.getBooleanValue("valid") ? 0 : 1; + if (!result.getJSONArray("not_exists").isEmpty()) { + warningLevel = 2; + } + item.put("warning_level", warningLevel); item.put("success", result.getBooleanValue("valid")); topReports.add(item); } diff --git a/src/main/ui/static/payment/validation/templates/valid-calendar.html b/src/main/ui/static/payment/validation/templates/valid-calendar.html index 7a89f9ad7..232e60798 100644 --- a/src/main/ui/static/payment/validation/templates/valid-calendar.html +++ b/src/main/ui/static/payment/validation/templates/valid-calendar.html @@ -11,8 +11,10 @@