From 5158c660013d52524559d4435f27b5e63d3221b7 Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Wed, 17 Nov 2021 13:54:25 +0800 Subject: [PATCH] screen-api 更改饼状图接口 --- 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