소스 검색

1.redis去掉密码,以便服务启动。

zhengqiang 5 년 전
부모
커밋
216dbe044f

+ 18 - 4
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonDeviceLogController.java

@@ -37,6 +37,8 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.joda.time.DateTime;
+import org.joda.time.Days;
+import org.joda.time.Months;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,10 +49,7 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
@@ -391,6 +390,21 @@ public class PersonDeviceLogController {
 
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
+            //起始时间和截止时间不能超过1一个月
+            if(searchParams.get("beginTime")==null || searchParams.get("endTime")==null){
+                throw new Exception("导出时间段不能为空!");
+            }
+            else{
+                DateTime beginTime = new DateTime(sdf.parse(searchParams.get("beginTime").toString()));
+                DateTime endTime = new DateTime(sdf.parse(searchParams.get("endTime").toString()));
+
+                int days = Days.daysBetween(beginTime,endTime).getDays();
+
+                if(days>31){
+                    throw new Exception("导出时间段不能超过1个月!");
+                }
+            }
+
             while(pageNum<=totalPages){
                 Page<PersonDeviceLog> page = personDeviceLogService.pageSearch(searchParams, pageNum, pageSize, needCount, sortList);
 

+ 1 - 1
web/src/main/resources/application-production.yml

@@ -21,7 +21,7 @@ spring:
     host: 127.0.0.1
     # Redis服务器连接端口
     port: 6379
-    password: 123456
+    password:
   rabbitmq:
     host: 127.0.0.1
     port: 5672