Commit dcc9498f by huangfusuper

休整时间溢出问题

parent c54383f0
...@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
......
package com.byit.service.impl; package com.byit.service.impl;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.byit.dto.api.DeleteDto; import com.byit.dto.api.DeleteDto;
...@@ -679,9 +681,11 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -679,9 +681,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil.dataNotNull(endTime, "结束时间不允许为空!"); ValidationUtil.dataNotNull(endTime, "结束时间不允许为空!");
ValidationUtil.isTrueValidation(String.valueOf(startTime).length() < 13 || String.valueOf(endTime).length() < 13 , "时间格式必须是毫秒"); ValidationUtil.isTrueValidation(String.valueOf(startTime).length() < 13 || String.valueOf(endTime).length() < 13 , "时间格式必须是毫秒");
Date startDate = new Date(startTime);
Date endtDate = new Date(endTime);
long between = DateUtil.between(startDate, endtDate, DateUnit.DAY);
//TODO 最长不能超过60天 //TODO 最长不能超过60天
ValidationUtil.isTrueValidation(endTime - startTime > 60 * 24 * 60 * 60 * 1000, "查询时间最长为60天!"); ValidationUtil.isTrueValidation(between > 60, "查询时间最长为60天!");
//获取工作空间名称 //获取工作空间名称
String workspaceName = jsonObject.getString("workspaceName"); String workspaceName = jsonObject.getString("workspaceName");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment