Commit c52bc3e3 authored by duanruiming's avatar duanruiming

[update] 态势检测-问题路口列表 优化拥堵指数1.57时不保留两位小数问题

parent 9b9117d7
......@@ -306,7 +306,8 @@ public class TrendServiceImpl implements TrendService {
abnormalCrossDetailVO.setCrossQueueLength(crossDataRealtimePO.getQueueLength());
abnormalCrossDetailVO.setCrossFlowRate((double)crossDataRealtimePO.getFlow());
abnormalCrossDetailVO.setCrossStopTimes(crossDataRealtimePO.getStopTimes());
abnormalCrossDetailVO.setCongestionIndex(crossDataRealtimePO.getCongestionIndex());
BigDecimal bigDecimal = BigDecimal.valueOf(crossDataRealtimePO.getCongestionIndex()).setScale(2, RoundingMode.HALF_UP);
abnormalCrossDetailVO.setCongestionIndex(bigDecimal);
// 构造转向实时数据
List<AbnormalCrossDetailVO.TurnDataElement> turnData = buildTurnData(crossId);
abnormalCrossDetailVO.setTurnData(turnData);
......@@ -1090,6 +1091,7 @@ public class TrendServiceImpl implements TrendService {
// 获取当前日期和时间的 Calendar 对象
Calendar calendar = Calendar.getInstance();
calendar.set(2024, Calendar.JANUARY, 15, 10, 0, 0);
// 设置时、分、秒和毫秒为 0,以获取当天的 00:00:00
calendar.set(Calendar.HOUR_OF_DAY, 0);
......@@ -1301,6 +1303,8 @@ public class TrendServiceImpl implements TrendService {
List<MainlineSchemeAnalysisVO.GreenwaveData> greenwaveData) {
Calendar now = Calendar.getInstance();
now.set(2024, Calendar.JANUARY, 15, 10, 0, 0);
String currentDayType = getDayType(now);
String currentTime = new SimpleDateFormat("HH:mm").format(now.getTime());
......
......@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
......@@ -26,7 +27,7 @@ public class AbnormalCrossDetailVO {
@ApiModelProperty(value = "平均停车次数")
private Double crossStopTimes;
@ApiModelProperty(value = "拥堵指数")
private Double congestionIndex;
private BigDecimal congestionIndex;
@ApiModelProperty(value = "转向实时数据")
private List<TurnDataElement> turnData;
@ApiModelProperty(value = "方向实时数据")
......
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