From 991cc64bcc9b869be5f8e9abe24f530d4fda6240 Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Thu, 18 Nov 2021 09:48:50 +0800
Subject: [PATCH] 修改方法名
---
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