Commit 93b08e28 authored by duanruiming's avatar duanruiming

[add] 干线绿波事件统计返回优化添加方向

parent 75173da9
...@@ -28,6 +28,7 @@ import net.wanji.opt.cache.BaseCrossInfoCache; ...@@ -28,6 +28,7 @@ import net.wanji.opt.cache.BaseCrossInfoCache;
import net.wanji.opt.common.RedisUtils; import net.wanji.opt.common.RedisUtils;
import net.wanji.opt.common.enums.EventInfoTypeEnum; import net.wanji.opt.common.enums.EventInfoTypeEnum;
import net.wanji.opt.common.enums.GreenBeltDirEnum; import net.wanji.opt.common.enums.GreenBeltDirEnum;
import net.wanji.opt.common.enums.GreenWaveInDirEnum;
import net.wanji.opt.dao.mapper.*; import net.wanji.opt.dao.mapper.*;
import net.wanji.opt.dto.GreenBeltChartDTO; import net.wanji.opt.dto.GreenBeltChartDTO;
import net.wanji.opt.entity.GreenChartSchemeHist; import net.wanji.opt.entity.GreenChartSchemeHist;
...@@ -46,6 +47,7 @@ import org.springframework.util.CollectionUtils; ...@@ -46,6 +47,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
...@@ -357,8 +359,15 @@ public class TrendServiceV2Impl implements TrendServiceV2 { ...@@ -357,8 +359,15 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
double durationRate = durationOffset / last.getDuration(); double durationRate = durationOffset / last.getDuration();
result.setCountRate((int) (Math.round(countRate * 100) )); result.setCountRate((int) (Math.round(countRate * 100) ));
result.setDurationRate((int) (Math.round(durationRate * 100) )); result.setDurationRate((int) (Math.round(durationRate * 100) ));
String greenDir = result.getGreenDir();
StringBuilder stringBuilder = new StringBuilder();
if (!StringUtils.isEmpty(greenDir)) {
for (String dir : greenDir.split(",")) {
stringBuilder.append(GreenBeltDirEnum.getCode(Integer.valueOf(dir))).append(",");
}
}
result.setGreenDir(stringBuilder.toString());
} }
} }
}); });
} }
......
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
select t1.id, t1.name, t1.wkt, t2.type, ifnull(t2.count, 0) as count, ifnull(t2.duration, 0) as duration, select t1.id, t1.name, t1.wkt, t2.type, ifnull(t2.count, 0) as count, ifnull(t2.duration, 0) as duration,
case when t2.type = '705' then '缓行次数' case when t2.type = '705' then '缓行次数'
when t2.type = '706' then '拥堵次数' when t2.type = '706' then '拥堵次数'
end as typeDesc end as typeDesc, t1.green_dir, t1.start_time
from from
t_greenwave_info t1 t_greenwave_info t1
left join ( left join (
......
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