From a8db8fd61f48e3f367cd5968c11ffa1596c52e2f Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Fri, 19 Nov 2021 08:51:23 +0800 Subject: [PATCH] screen-api 增加污染等级柱状图接口mock数据 --- screen-api/src/main/java/com/moral/api/pojo/form/aqi/QueryPieChartOfPollutionLevelForm.java | 42 +++++++++++++++++++++++++++++------------- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/pojo/form/aqi/QueryPieChartOfPollutionLevelForm.java b/screen-api/src/main/java/com/moral/api/pojo/form/aqi/QueryPieChartOfPollutionLevelForm.java index f8ae421..20da5e5 100644 --- a/screen-api/src/main/java/com/moral/api/pojo/form/aqi/QueryPieChartOfPollutionLevelForm.java +++ b/screen-api/src/main/java/com/moral/api/pojo/form/aqi/QueryPieChartOfPollutionLevelForm.java @@ -18,32 +18,48 @@ public class QueryPieChartOfPollutionLevelForm { /* - * ��������� ������ - * */ + * ��������� ������ + * */ Integer regionCode; /* - * ��������������������� - * ��������������������������������������������������������� - * */ + * ��������������������������������������������������� + * */ + @DateTimeFormat(pattern = "yyyy") + @JsonFormat(pattern = "yyyy", timezone = "GMT+8") + Date year; + + /* + * ��������������������������������� + * */ @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") Date startDate; /* - * ��������������������� - * */ + * ��������������������������������� + * */ @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") Date endDate; - public boolean valid(){ - if(regionCode==null) + public boolean valid() { + if (regionCode == null) return false; - //��������������������������������������������������������������������������������������������������� - if(startDate==null||endDate==null){ - startDate = DateUtils.getFirstDayOfCurrYear(); - endDate = DateUtils.getYesterdayDate(); + //������������������������������������������������������ + if (startDate == null || endDate == null) { + if (year == null) + return false; + //��������������������� + if (DateUtils.isCurrentYear(year)) { + startDate = DateUtils.getFirstDayOfCurrYear(); + endDate = DateUtils.getYesterdayDate(); + return true; + }else{ + startDate = DateUtils.getFirstDayOfYear(year); + endDate = DateUtils.getLastDayOfYear(year); + return true; + } } return true; } -- Gitblit v1.8.0